Commit Graph

528 Commits (4fdc8eebcdfb8d98c2a120b3b8d661ed8abaa91b)

Author SHA1 Message Date
Wilfred Hughes 4fdc8eebcd Increase MSRV to 1.59 2023-08-07 20:32:08 +07:00
Wilfred Hughes 892d4fdb58 Ensure size_hint never exceeds graph_limit
If we have thousands of syntax nodes on both sides, we can end
up attempting to preallocate a very large hashmap.

In #542, a user hit an issue with two JSON files where the LHS had
33,000 syntax nodes and the RHS had 34,000 nodes, so we'd attempt to
preallocate a hashmap of capacity 1,122,000,000. This required
allocating 70,866,960,400 bytes (roughly 66 GiB).

Impose a sensible limit on the hashmap.

Fixes #542
2023-08-04 17:19:27 +07:00
Wilfred Hughes 757c297412 Adjust header style
Show the hunk count and detected language in a dimmed style. This
information is less important than the diff content itself, so this
change makes the important information more prominent.

First part of #544
2023-07-31 08:35:27 +07:00
Wilfred Hughes 797af40ae8 Improve Java highlighting 2023-07-27 08:33:38 +07:00
Wilfred Hughes 448972f8a3 Roll version 2023-07-26 20:02:23 +07:00
Wilfred Hughes b3acf48128 Bump minimum required Rust version to 1.58
Difftastic is generally conservative about MSRV, and will only
increase the version when there is a compelling reason (e.g. major
performance improvement, important bug fix in a dependendency).

This version increase will enable us to upgrade crossterm to 0.26, which
has better detection of terminal width on Windows.

I've also clarified MSRV details for other dependencies that cannot
currently be upgraded.
2023-07-26 11:34:05 +07:00
Wilfred Hughes 69da133ab0 Merge commit '2c7aff437deed72bbceceab95797b3909cc4627d' 2023-07-24 21:50:22 +07:00
Wilfred Hughes f43e91faf7 Merge commit 'ad095896dd223f1c22b85ac5ec84ab11fb732b07' 2023-07-24 21:28:47 +07:00
Wilfred Hughes 4e9637c861 Check more bytes when detecting encoding
I've observed PDF files that have sufficiently large headers that they
were detected as text, which wasn't helpful.

Also improve logging to report how many invalid bytes were found.
2023-07-21 08:34:41 +07:00
Wilfred Hughes 1c0b3153df Fix typo 2023-07-21 08:32:17 +07:00
Wilfred Hughes 2d23eb549d Document the new LaTeX support 2023-07-20 23:05:18 +07:00
Wilfred Hughes a15b92afaf Merge commit '6c8329e2da78fae78e87c3c6f5788a2b005a4afc' 2023-07-15 15:59:11 +07:00
Wilfred Hughes 7caaaf7fcf Handle nested sliders correctly when preferring the outer delimiter
Previously we didn't check the state of children, which was an
oversight from the original implementation. As a result, we fixed
nested sliders in fewer situations.

Fixes #535
2023-07-14 08:49:55 +07:00
Wilfred Hughes a5d3cb55b7 Treat constructors consistently with variables in Haskell atoms 2023-07-12 17:34:42 +07:00
Wilfred Hughes 2d2a1484fd Roll version 2023-07-12 17:10:34 +07:00
Wilfred Hughes 5606c04261 Treat qualified modules and variables as atoms in Haskell 2023-07-12 12:34:39 +07:00
Wilfred Hughes d9382640ed Mention the new subword string highlighting in the changelog 2023-07-10 09:04:53 +07:00
Wilfred Hughes 27f59c0b3a Don't treat - as a word constituent
This produces slightly better results with some string replacements.
2023-07-08 17:16:14 +07:00
Wilfred Hughes c07e640b24 Remove contiguous penalty
The contiguous penalty was an attempt to fix the slider problem:

// Old
A B
C D

// New
A B
A B
C D

// Unwanted diff
A +B+
+A+ B
C D

However, it doesn't make sense for Dijkstra, which is stateless. The
best route from vertex X is independent of how we got to vertex X.

This worked by dumb luck: in some circumstances we terminate early
rather than fully executing Dijkstra's algorithm. This cost tweak
improved results on a few test files. However, the post-processing
slider logic is a proper, general solution. This was added much later.

There's no reason to keep the contiguous penalty now. It's confusing,
and makes adding new edge costs with consistent 'X costs more than Y'
behaviours more difficult.

Performance is essentially neutral: a small decrease in
typing_before.ml, a small increase in slow_before.rs.
2023-07-06 08:37:02 +07:00
Wilfred Hughes c405b58327 Fix cost for ReplacedComment
This needs to be 2x novel nodes, or we prefer it far too often.
2023-07-02 23:12:31 +07:00
Wilfred Hughes 3730580ca3 Improve word splitting heuristics
This is particularly noticeable when diffing comments with timestamps
2000-12-31T23:59:59 where we don't want 31T23 to be a single word.
2023-06-29 08:33:30 +07:00
Wilfred Hughes 63a5eeaa98 Update changelog for Scala parser update
Fixes #521
2023-06-12 22:28:56 +07:00
Wilfred Hughes b0a3a0ada9 Use DFT_LOG as the internal logging environment variable
Fixes #519
2023-05-21 23:33:34 +07:00
Wilfred Hughes 26bb4bb7ed Fix punctuation 2023-05-17 22:46:47 +07:00
Wilfred Hughes b2abf528b3 Fix markdown 2023-05-17 22:45:34 +07:00
Wilfred Hughes f1acd3aab4 Roll version 2023-05-16 21:13:51 +07:00
Wilfred Hughes b6895d42e4 Document the --override option in CHANGELOG and --help
This also enables users to disable language parsing.
Closes #439
Closes #440
2023-05-15 23:04:20 +07:00
Wilfred Hughes 84af470128 Remove --language 2023-05-14 15:57:43 +07:00
Wilfred Hughes 05a1b184ea Use globbing to match file names in language detection 2023-05-14 15:50:56 +07:00
Wilfred Hughes bde09efb80 Update changelog and tests for new path printing logic 2023-04-15 21:08:40 +07:00
Wilfred Hughes efd57ddbae Update changelog and manual for Solidity support 2023-04-12 00:56:13 +07:00
Wilfred Hughes 2296c9f739 Update version of next release 2023-04-01 16:20:17 +07:00
Wilfred Hughes 81ac13cbd3 Roll version following release 2023-03-31 08:37:06 +07:00
Wilfred Hughes 8b842387a1 Don't clean trailing newline before diffing
Difftastic should take the user's input as-is, or it risks performing
an incorrect diff in both textual and syntactic diffing.

Fixes #499
2023-03-30 08:46:11 +07:00
Wilfred Hughes 1e9f437688 Remove --missing-as-empty 2023-03-17 08:40:21 +07:00
Wilfred Hughes 6d99ea41c1 Merge commit 'ff1f0ac0f1c678a23f68d0140e75a0da8e11b7b5' 2023-03-17 00:46:11 +07:00
Wilfred Hughes 6ae589766c Merge commit 'ab75be9750e6f2f804638824d1790034286a830c' 2023-03-17 00:45:03 +07:00
Wilfred Hughes 6a455faa06 Merge commit 'b66d19b9b6ec3edf3d8aff0c20646acbdaa0afb3' 2023-03-17 00:14:19 +07:00
Wilfred Hughes e24ca47173 Merge commit '5720b249490b3c17245ba772f6be4a43edb4e3b7' 2023-03-17 00:13:21 +07:00
Wilfred Hughes aef2a84fa5 Merge commit 'f1106bf834703f1f2f795da1a3b5f8f40174ffcc' 2023-03-17 00:09:44 +07:00
Wilfred Hughes 8266e0a161 Merge commit '64457ea6b73ef5422ed1687178d4545c3e91334a' 2023-03-17 00:05:52 +07:00
Wilfred Hughes f76dfdc4f0 Merge commit '3c24aa9365985830421a3a7b6791b415961ea770' 2023-03-17 00:01:50 +07:00
Wilfred Hughes 1c01128050 Update changelog for last commit 2023-03-16 22:12:10 +07:00
Wilfred Hughes b914149ccf Merge commit '399605a02bcd5daa309ce63a6459c600dce3473f' 2023-03-16 08:20:22 +07:00
Wilfred Hughes 7fbe0d6c2f Improve UTF-16 detection heuristics and add test 2023-03-16 00:31:58 +07:00
Wilfred Hughes b1ecf00602 Merge commit 'fcacbeb4af6bcdcfb4527978a997bb03f4fe086d' 2023-03-15 23:50:56 +07:00
Wilfred Hughes 630e843a66 Merge commit '03fa93db133d6048a77d4de154a7b17ea8b9d076' 2023-03-15 23:24:58 +07:00
Wilfred Hughes b636201a8c Merge commit 'f35789006ccbe5be8db21d1a2dd4cc0b5a1286f2' 2023-03-15 21:49:50 +07:00
Wilfred Hughes 4eaba59c5e Merge commit 'b338fa9f4807b9e0336cd4dde04948a8c324a4cf' 2023-03-15 16:11:16 +07:00
Wilfred Hughes 20ad284882 Add 'vendored_parsers/tree-sitter-clojure/' from commit '421546c2547c74d1d9a0d8c296c412071d37e7ca'
Closes #448

git-subtree-dir: vendored_parsers/tree-sitter-clojure
git-subtree-mainline: ebfc043a4a
git-subtree-split: 421546c254
2023-03-15 15:43:55 +07:00