Commit Graph

288 Commits (bd9c98050e2feb4239fc9f9b65642e26817edf04)

Author SHA1 Message Date
Wilfred Hughes fadd0f22ef Support Windows-1252 and make UTF-16 detection stricter
Fixes #797
2025-01-04 15:48:39 +07:00
Wilfred Hughes a6eb339f71 Use tree-sitter-toml from crates.io 2024-12-20 09:07:52 +07:00
Wilfred Hughes 15b9590db5 Use tree-sitter-julia from crates.io 2024-12-20 08:25:23 +07:00
Wilfred Hughes 88731f932d Use tree-sitter-javascript from crates.io 2024-12-20 00:02:14 +07:00
Wilfred Hughes de6e6707d2 Use tree-sitter-ocaml from crates.io 2024-12-19 23:14:12 +07:00
Wilfred Hughes 79bdf87c97 Remove old vendored haskell parser 2024-12-19 22:41:54 +07:00
Wilfred Hughes 0ca2c594a3 Accept the hightlighting changes
elvish: less highlighted as bold, seems like a small regression

hcl: not highlighting variables in bold now, a small regression

smali: more stuff in bold overall, but no longer the method name in bold
2024-12-19 21:11:55 +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 511b7579fb Fix min() which should be max() 2024-10-21 22:53:28 +07:00
Wilfred Hughes 845bbeafff Cap the maxmimum size of columns in side-by-side display 2024-10-21 09:04:29 +07:00
Wilfred Hughes 8cdb59fa5e Normalise newlines before diffing
This produces good, consistent results on different trailing newlines
before, consistent with the behaviour before 7edd2a82cd (see #755).
2024-10-21 08:34:39 +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 1ac95534fe Don't push empty positions when diffing lines 2024-07-30 16:16:34 +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
Hugo van Rijswijk df76ea2369 Update compare result 2024-07-23 12:55:49 +07:00
Wilfred Hughes 92fa3fb3de Ensure files with no common content are aligned 2024-07-20 23:43:04 +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 7827a059cb Update F# expected output 2024-05-25 14:58:14 +07:00
Wilfred Hughes a9bcee7733 Add sample conflicts file
This is already referenced in the manual.
2024-05-14 10:14:05 +07:00
Wilfred Hughes d92b65c5fd Merge remote-tracking branch 'thecentury/f#' 2024-05-14 09:46:55 +07:00
Wilfred Hughes d292546df7 Prefer 'device tree' as two words 2024-05-13 16:59:48 +07:00
Wilfred Hughes d3e5aa5232 Merge remote-tracking branch 'blmaier/support-devicetree' 2024-05-13 16:50:13 +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 e51834fa77 Support comment.foo highlighting queries
This should improve highlighting in cases like Elm that use
`@comment.elm`.
2024-05-11 16:08:29 +07:00
Wilfred Hughes 5c40cd0282 Prefer _1 and _2 naming for test files
This is less to type, and it's now alphabetical, so e.g.
sample_files/*.kt just works as a test argument.
2024-04-28 23:28:06 +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
Alexis (Poliorcetics) Bourget 1f79d16606 tests: show that hidden files are not picked up by difftastic 2024-04-01 08:32:46 +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 b78f7d447b Always replace tabs, even in single-column display
Fixes #617
2024-03-04 21:38:23 +07:00
Wilfred Hughes 7ddd8879b1 Merge branch 'scheme-support' of github.com:kutsurak/difftastic into kutsurak-scheme-support 2024-03-04 08:46:59 +07:00
Wilfred Hughes 53298e4240 Set a length limit on lines when doing a word diff
See #653
2024-02-29 00:54:55 +07:00
Brandon Maier e6b27caf06 Add support for devicetrees 2024-02-28 17:11:53 +07:00
Wilfred Hughes 7a00339977
Merge pull request #634 from evanrichter/smali
Smali language support
2024-02-19 11:57:54 +07:00
Wilfred Hughes 4fef3f7b00 Update regression test for QML parser 2024-02-15 23:40:56 +07:00
Wilfred Hughes e70224bb22 Update regression tests for new JS/TS parsers 2024-02-15 08:30:57 +07:00
Panagiotis Koutsourakis 67ada1ccd4 Add support for Scheme 2024-02-12 10:20:57 +07:00
Evan Richter d106c979ee add smali language support 2024-02-01 15:41:14 +07:00
Mikhail Brinchuk 297fa952c2
Merge branch 'Wilfred:master' into f# 2024-01-29 11:45:31 +07:00
Wilfred Hughes a3731067b2
Merge pull request #618 from arbrauns/tree-sitter-vhdl
Add tree-sitter-vhdl
2024-01-28 12:04:53 +07:00
Wilfred Hughes 6c4310e33b Remove macro from Objective-C sample file so it parses fully 2024-01-28 11:02:58 +07:00
Mikhail Brinchuk 9a894d5369 Added a regression test for F# 2024-01-28 12:36:13 +07:00
Armin Brauns c5638750d6 Add tree-sitter-vhdl 2024-01-09 09:23:51 +07:00
Wilfred Hughes 5c67ed08a9 Update integration test for new tab width 2024-01-07 19:26:07 +07:00
Wilfred Hughes db86b28a28 Add support for Objective-C
Closes #600

Co-authored-by: Nick Moore <nick@pilotmoon.com>
2024-01-07 12:50:19 +07:00
Wilfred Hughes db0c150f61 Report permission changes
Fixes #605
2023-12-30 11:20:00 +07:00
Wilfred Hughes 001279a2e1 Update expected output test 2023-12-08 21:51:29 +07:00
Rodolphe Blancho e18b5d0712
Merge branch 'master' into feature/salesforce_apex_support 2023-12-05 12:31:59 +07:00
Wilfred Hughes 569f0038d1 Always filter blank lines at start and end in positions
Fixes #595
2023-11-28 12:35:28 +07:00