Commit Graph

1873 Commits (c73b18be77ca73e461a991bf8d30a8c5f95af597)

Author SHA1 Message Date
idea-list 6bbeb53c68 Parse pdm.lock and uv.lock as TOML 2024-09-05 00:11:09 +07:00
Wilfred Hughes 3c62ff37c0 Include OS in --version
Fixes #757
2024-08-29 22:52:36 +07:00
Alexander Ilin b021c079aa Find and replace all instances of "the all the" with "all the" 2024-08-26 08:17:51 +07:00
Wilfred Hughes 96ff1e8dbd Tweak comment 2024-08-26 08:16:36 +07:00
Marcel 4d6eaf65e2
add mjml as xml 2024-08-03 02:38:27 +07:00
Wilfred Hughes 1ac95534fe Don't push empty positions when diffing lines 2024-07-30 16:16:34 +07:00
Wilfred Hughes 86612798ad Try ignoring trailing newlines in line-based differ 2024-07-30 16:09:40 +07:00
Wilfred Hughes 0973998de2 Clarify enum variant NovelLinePart and expand doc comments 2024-07-30 15:33:37 +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 78650c310a Improve accuracy of conservative width estimation optimisation 2024-07-21 11:37:27 +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 1e8be4558b Fix performance when splitting very long lines during display 2024-07-20 23:38:16 +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 27a0cfba16 Silence some clippy warnings 2024-06-29 23:08:11 +07:00
Marcel 759797c851 guess_language: add flake.lock as json 2024-06-27 08:09:28 +07:00
Wilfred Hughes d7188f7178 Remove unused struct 2024-05-25 14:55:39 +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 809f49124c Remove empty comment 2024-05-11 22:10:17 +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 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 6a3b340d5f Prefer 'terminal' over 'display' terminology 2024-05-10 15:53:40 +07:00
Wilfred Hughes ec7a765453 Factor out a constant for the default terminal width 2024-05-10 15:50:56 +07:00
Wilfred Hughes 1954f15e0d Fix typo 2024-05-07 08:50:54 +07:00
Wilfred Hughes 03d1f9bf26 Lint against .to_string() on String 2024-05-07 08:39:07 +07:00
Wilfred Hughes 9474635076 Prefer .to_owned() on &str 2024-05-07 08:32:30 +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
Wilfred Hughes 7f5c11c075 cargo fmt 2024-04-28 16:40:00 +07:00
Wilfred Hughes 8655a9464e Fix unwanted duplicate node in existing vec
Broken in previous commit. This is now only a few percentage points
performance win, but it's still a net improvement.
2024-04-28 16:35:40 +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 26e1ae40ef Fix clippy lints 2024-04-28 16:09:54 +07:00
Steinar H. Gunderson 302570591f Make Stack be allocated on the arena.
This fixes another memory leak, and also removes the need for
refcounting the Stack objects and the Node objects they point to.
2024-04-28 15:46:23 +07:00
Steinar H. Gunderson 4fb1478817 Fix memory leak in neighbours array.
Vertex is allocated on the arena, so it is never dropped;
then it cannot contain a Vec allocated on the regular heap
without leaking memory. Replace the Vec with a slice allocated
on the arena, which seems to fix most of the leaks. (Some may
remain; I haven't checked fully.) It should also be slightly
more memory-efficient.

It's not clear that we actually need the RefCell instead of
just putting Option directly into the structure, but I've
let it stay.

This issue was probably introduced in a71d6118cf.
2024-04-28 15:46: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
Alexis (Poliorcetics) Bourget 573d607051 fix: diff hidden but non-ignored files when walking directories 2024-04-01 08:32:46 +07:00
Rhys Botfield e096444e73
Merge branch 'Wilfred:master' into add-php-file-extensions 2024-03-25 19:04:49 +07:00
Rhys Botfield e5e7d1cfb7 Format PHP extensions in guess_language.rs
To keep rustfmt happy
2024-03-22 21:32:25 +07:00
Wilfred Hughes c8655d23bd Trace git environment variables 2024-03-20 08:26:30 +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 93ae0e91db Fix typos 2024-03-12 23:08:39 +07:00
Wilfred Hughes 3d29dc1228 Silence some clippy lints 2024-03-11 22:26:30 +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
Wilfred Hughes 5f5085637e Treat Scheme as a lisp when handling sliders 2024-03-06 21:55:31 +07:00
Wilfred Hughes 7346c895f0 Fix new files claiming they have permission changes 2024-03-04 22:54:57 +07:00
Wilfred Hughes b95e6cc6e6 Fix Scheme globs 2024-03-04 22:25:16 +07:00
Wilfred Hughes 247727066f Handle whitespace in shebangs 2024-03-04 22:10:08 +07:00
Wilfred Hughes 6ff603cc6e Support some more Scheme file extensions 2024-03-04 22:06:19 +07:00
Wilfred Hughes d5c60241ef Detect more Makefile naming patterns 2024-03-04 22:06:09 +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 5e38261b77 cargo fmt 2024-02-29 00:56:16 +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
Wilfred Hughes 7e8f928926 Add doc comments 2024-02-29 00:10:52 +07:00
Brandon Maier e6b27caf06 Add support for devicetrees 2024-02-28 17:11:53 +07:00
Wilfred Hughes 1b2099d7a4 Fix windows build 2024-02-26 20:55:45 +07:00
Wilfred Hughes bb9e864ffe Fix permissions always shown as 'changed' with git-difftool 2024-02-20 00:17:38 +07:00
Wilfred Hughes cbbcbb3094 Parse file mode properly from git and pass through 2024-02-20 00:07:06 +07:00
Wilfred Hughes 1cc0c42c20 Detect git difftool paths and prefer the second argument
Fixes #620
2024-02-19 22:19:20 +07:00
Wilfred Hughes 9032c2ff89
Merge pull request #643 from baz-scm/json-output-respect-unchanged-files
Allow JSON output to respect skip-unchanged
2024-02-19 12:00:59 +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 bf047030d2 Add a unit tests that validates that all language configs are valid 2024-02-15 08:47:58 +07:00
Nimrod 679d1ce65a Impl PartialEq 2024-02-14 16:13:08 +07:00
Nimrod 9f8d79bb7f Allow JSON output to respect skip-unchanged 2024-02-14 16:08:40 +07:00
Panagiotis Koutsourakis 67ada1ccd4 Add support for Scheme 2024-02-12 10:20:57 +07:00
Rhys Botfield 55b9630069 Add extra PHP file extensions to the language guesser. 2024-02-09 14:43:20 +07:00
Wilfred Hughes cd65d48619 Silence a clippy warning 2024-02-08 08:40:47 +07:00
Wilfred Hughes 4146067be1 Prefer implementing Display over a custom .display() method 2024-02-08 08:34:48 +07:00
Evan Richter d106c979ee add smali language support 2024-02-01 15:41:14 +07:00
Wilfred Hughes 7fda26d68a cargo fmt 2024-01-30 21:25:01 +07:00
Wilfred Hughes 052b3a62a3 Use XML file headers as language detection hints
Fixes #630
2024-01-30 21:22:51 +07:00
Wilfred Hughes 5219977d88 Add comment to language detection logic 2024-01-29 21:57:40 +07:00
Godefroid Chapelle 992f9cf11d
ZCML is XML
Zope and Plone ZCML (Zope Configuration Markup Language) is XML.
2024-01-29 16:40:48 +07:00
Mikhail Brinchuk 297fa952c2
Merge branch 'Wilfred:master' into f# 2024-01-29 11:45:31 +07:00
Mikhail Brinchuk 045344f783 Fixed rust format 2024-01-28 12:52:07 +07:00
Mikhail Brinchuk 0e4723cf0e Added F# support 2024-01-28 12:11:53 +07:00
Armin Brauns c5638750d6 Add tree-sitter-vhdl 2024-01-09 09:23:51 +07:00
Wilfred Hughes 2d61aefb84 Fix tab replacement in single-column display
Fixes #617
2024-01-07 19:35:33 +07:00
Wilfred Hughes 8ad07174c9 Fix spelling 2024-01-07 19:28:29 +07:00
Wilfred Hughes bc0cbaf3ae Change default tab width to 4
This is more consistent with web UIs like GitHub, so I think it's a
better default.
2024-01-07 13:15:12 +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 50a03b4b14
Merge pull request #614 from yuja/push-utqlvwnvuwrl
Fix dir-diff paths merging to not add duplicated entries from remainder
2024-01-05 08:47:24 +07:00
Wilfred Hughes 35a182dd42 Remove bool_to_int_with_if clippy config
This doesn't exist in Rust 1.63 (it was added in 1.65) and 1.67 moved
it to allow-by-default anyway.
2024-01-05 08:39:08 +07:00
Yuya Nishihara 19e21cda90 Fix dir-diff paths merging to not add duplicated entries from remainder
If lhs_paths and rhs_paths are ["a", "c"] and ["a", "b", "c"] respectively, the
loop ends with paths = ["a", "c", "b"], i = j = 2. We still need to deduplicate
"c" from the rhs_paths.

.into_iter() can't be used anymore since the seen set still borrows the paths.
2024-01-02 10:53:18 +07:00
Wilfred Hughes db0c150f61 Report permission changes
Fixes #605
2023-12-30 11:20:00 +07:00
Wilfred Hughes 68f28a8085 More use of renamed over extra_info 2023-12-29 19:51:14 +07:00
Wilfred Hughes b71c553d07 Clarify field that is a path description, not a path 2023-12-29 19:47:39 +07:00
Wilfred Hughes 5d2a4777dc Simlify pattern matches 2023-12-29 19:47:17 +07:00
Wilfred Hughes 8b90c95e01 When called with a single path, require conflict markers
Fixes #585
2023-12-29 19:39:44 +07:00
Wilfred Hughes c180fb52a9 Treat strict types in Haskell as atoms
This isn't ideal: it prevents a finegrained diff of syntax within a type, but it
beats claiming that the code is unchanged.

Fixes #607
2023-12-28 19:24:35 +07:00
Wilfred Hughes 26c58a25e8 Treat regex literals as atoms in Clojure 2023-12-17 10:46:15 +07:00
Wilfred Hughes 72348338aa Style warnings more prominently 2023-12-14 09:07:47 +07:00
Wilfred Hughes 5fd9dfe4a9 Treat *.xsd as XML
Fixes #602
2023-12-08 21:34:07 +07:00
Wilfred Hughes 4a8f983f2f
Merge pull request #579 from rody/feature/salesforce_apex_support
Add salesforce apex support
2023-12-07 08:45:33 +07:00
Yuya Nishihara 8e35c9272c Drop use of AtomicBool from diffing frontend
All diff consumers can now access to a mutable bool.
2023-12-07 08:37:42 +07:00