Commit Graph

651 Commits (776d978f09f46b7214b2564155260fb26c35019c)

Author SHA1 Message Date
Wilfred Hughes 776d978f09 Use tree-sitter-typescript from crates.io 2024-12-20 00:09:12 +07:00
Wilfred Hughes 88731f932d Use tree-sitter-javascript from crates.io 2024-12-20 00:02:14 +07:00
Wilfred Hughes db379cf94d Use tree-sitter-c and tree-sitter-cpp from crates.io 2024-12-19 23:50:23 +07:00
Wilfred Hughes 6ea71e6983 Use tree-sitter-python from crates.io 2024-12-19 23:38:43 +07:00
Wilfred Hughes 2bbed44664 Use tree-sitter-c-sharp from crates.io 2024-12-19 23:21:26 +07:00
Wilfred Hughes de6e6707d2 Use tree-sitter-ocaml from crates.io 2024-12-19 23:14:12 +07:00
Wilfred Hughes 919f15344f Use tree-sitter-objc from crates.io 2024-12-19 23:00:43 +07:00
Wilfred Hughes 913aee1c07 Use tree-sitter-scala from crates.io 2024-12-19 22:56:33 +07:00
Wilfred Hughes b4bf322b13 Update changelog for Ruby parser 2024-12-19 22:52:26 +07:00
Wilfred Hughes bbe4890cfd Use tree-sitter-haskell from crates.io 2024-12-19 22:33:28 +07:00
Wilfred Hughes f68948ffeb Increase MSRV to 1.74.1
This will enable usage of the new tree-sitter-language crate.
2024-12-19 21:25:00 +07:00
Wilfred Hughes 3a1e398edc Improve handling of named pipe arguments
Use display_name in more places, and prefer file names with extensions
when we have two arguments.

Fixes #783
2024-11-15 23:11:25 +07:00
Wilfred Hughes 4df51dc57c Improve syntax highlighting on tree-sitter lists that are just keywords
Closes #777
2024-11-15 00:03:30 +07:00
Wilfred Hughes 549cb483fe Fix crash due to trailing newlines in string nodes at EOF
Fixes #782
2024-11-15 00:03:30 +07:00
Wilfred Hughes c2e98bb65a Roll version 2024-10-24 08:17:18 +07:00
Wilfred Hughes 870d1411a0 Link to relevant page in manual 2024-10-23 22:27:01 +07:00
Wilfred Hughes 6a5f5d6f00 Document side-by-side changes 2024-10-23 08:47:28 +07:00
Wilfred Hughes f58c9e074a Bump MSRV to 1.66 2024-10-15 23:15:07 +07:00
Wilfred Hughes 7edd2a82cd Always consider newlines when diffing lines
StringIgnoringNewline caused crashes in code that assumed that two
equal values would hav the same string length.

This reverts 86612798ad. A better
approach would be to normalise line endings before diffing, but
additionally print whether files have/lack trailing newlines.

Fixes #755
2024-10-15 08:46:34 +07:00
Wilfred Hughes 393845ddcb Change recommended git configuration
`git-difftool` has strictly less information than `git-diff`.
`git-difftool` therefore produces worse results, and we shouldn't
recommend it.

`git-difftool` does not have file rename information, and sometimes
makes difftastic claim that file permissions have changed (depending
on the permissions of the temporary directory used).

Instead, recommend `git-diff` with an external diff configured, and
update `git-mergetool` instructions to emulate `git-diff` as much as
possible (respecting $MERGED).

Also link to the upstream git bug on segfaults with external diff
tools.

Thanks to @poliorcetics and @gthb for researching this bug and
discussing possible solutions.

Closes #734
Fixes #620
2024-09-22 20:11:36 +07:00
Wilfred Hughes 53477fb46d 0.60 is released 2024-08-06 22:07:58 +07:00
Wilfred Hughes 5a51c02157 Fix crash when the last hunk includes the trailing newline at EOF
Input cleaning should happen before we diff the content, not during
display. Previously display would crash due to line numbers
referencing the line that had been stripped.

Fixes #713
Fixes #739
Fixes #742
2024-07-26 08:54:20 +07:00
Wilfred Hughes c2f4b1f2ee Update tests and changelog for 1e8be4558b 2024-07-21 11:15:54 +07:00
Wilfred Hughes 92fa3fb3de Ensure files with no common content are aligned 2024-07-20 23:43:04 +07:00
Wilfred Hughes fa2ec359d7 Roll version 2024-07-20 16:11:55 +07:00
Wilfred Hughes ffe27c575e Ensure line splitting distinguishes "foo" and "foo\n"
We rely on being able to split lines and rejoin them to obtain the
original string. `str::lines()` in the Rust stdlib does not have this
property.

This was causing crashes in word-diffing on textual diffing, where
code paths differed on the number of lines they thought a string had.

This was broken in 8b842387a1.

Fixes #688.
2024-07-20 16:09:44 +07:00
Wilfred Hughes a259c858a1 Update F# docs 2024-05-14 10:13:37 +07:00
Wilfred Hughes d292546df7 Prefer 'device tree' as two words 2024-05-13 16:59:48 +07:00
Wilfred Hughes de9c84c418 Document new addition 2024-05-13 16:52:33 +07:00
Wilfred Hughes 28d8673371 Treat tree-sitter nodes highlighted as comments as atoms
Fixes #711
2024-05-11 22:03:59 +07:00
Wilfred Hughes 835c5eb757 Roll version following release 2024-05-11 13:54:42 +07:00
Wilfred Hughes 0c9277108b It's not actually a 2x perf win
It's more like a 15% reduction in instruction count, which is still
nice.
2024-05-10 16:28:16 +07:00
Wilfred Hughes edb839c803 Improve terminal width detection
Ensure the value is always non-zero, and consider $COLUMNS if
crossterm does not succeed.

Fixes #707
2024-05-10 16:26:48 +07:00
Wilfred Hughes e23b9fc224 Update CMake parser 2024-04-28 23:53:12 +07:00
Wilfred Hughes ecaee577b2 Update Elm parser 2024-04-28 23:50:29 +07:00
Wilfred Hughes ae77a9cdf7 Document C++ parser change 2024-04-28 23:43:58 +07:00
Wilfred Hughes 27fb722ac7 Merge commit '1aafaff4d26dac5a36dd3495be33e1c20161d761' 2024-04-28 23:31:25 +07:00
Wilfred Hughes cce7b2ee1b Merge commit 'b466ffb4d7ce0a833754429ad8d3a02e950ed74c' 2024-04-28 23:00:00 +07:00
Wilfred Hughes a5b2587eaa Merge commit 'eb68645662a3f7bf7fdd4bcb9531585f54c8570e' 2024-04-28 22:54:18 +07:00
Wilfred Hughes c2df185d49 Update Lua parser
Closes #701
2024-04-28 22:36:23 +07:00
Wilfred Hughes 2e016566ac Update CSS parser 2024-04-28 21:45:25 +07:00
Wilfred Hughes 38f148df1f Don't flatten error nodes
As of b9d44ae65f (released in 0.38), difftastic prefers a textual
diff if any parse errors are present. As a result, users have to
opt-in to allowing parse errors. We can now preserve structure to
produce diffs that are more granular, at the slight risk of changes
being missed if parsers discard tokens.

Fixes #703
2024-04-28 17:28:34 +07:00
Wilfred Hughes d15d593708 Move to smallvec for seen vertices
This is a surprisingly large perf win. On my Thinkpad:

typing_before/after.ml:
before: 3.038B instructions
after:  2.870B instructions

slow_before/after.rs:
before: 2.381B instructions
after:  1.260B instructions (!)
2024-04-28 16:16:47 +07:00
Wilfred Hughes d2cdb96e00 Expand man page and add to changelog 2024-04-28 15:07:23 +07:00
Wilfred Hughes f52ca706f3 Enable --strip-cr by default
Line ending differences between input files often leads to confusing
diffs, so remove carriage returns unless explicitly requested.

Fixes #653
Fixes #696
2024-04-09 08:37:41 +07:00
Wilfred Hughes db281c682c Roll version 2024-04-02 08:17:24 +07:00
Wilfred Hughes 00e837aeb1 Update changelog 2024-04-01 22:42:16 +07:00
Wilfred Hughes 3be8e80fe7 Fix issue with later lines not having positions during diffing 2024-03-19 00:25:18 +07:00
Wilfred Hughes 34fa3d6eff Use a blank line after all diff summaries 2024-03-07 08:19:58 +07:00
Wilfred Hughes c6da85759c Consider null bytes in text file detection 2024-03-06 23:07:59 +07:00