Commit Graph

7638 Commits (85f2d7aa4bf343adf8f8a4fd20a3b0cdd86556c2)
 

Author SHA1 Message Date
Wilfred Hughes 85f2d7aa4b Print each hunk immediately
This gives the user output sooner and is very marginally faster
overall too. It's also slightly less code.

Closes #128
2022-02-07 21:40:56 +07:00
Wilfred Hughes ecb9e90d0a Ensure that context::novel_lines handles NovelLinePart
Fixes #129
2022-02-07 21:11:58 +07:00
Wilfred Hughes ab8e8e4485 Treat NovelLinePart as a change
Previously we'd treat it as unchanged, leading to incorrect text diffs
when words were added on a single side.

Fixes #122
2022-02-07 20:37:01 +07:00
Wilfred Hughes 908c2509d6 Rename UnchangedLinePart to NovelLinePart to reflect its usage
It's used in larger novel atoms (big comments and big string
literals).
2022-02-07 20:25:06 +07:00
Wilfred Hughes 72034f141d Clarify MatchKind name for novel words 2022-02-07 20:24:01 +07:00
Wilfred Hughes 1d2f08ca75 Improve internal docs 2022-02-07 20:21:39 +07:00
Wilfred Hughes 2f591b9b86 Log the number of nodes when we exceed the limit 2022-02-07 09:33:50 +07:00
Wilfred Hughes 5186bffe83 Improve efficiency of line-based diffing
On my large JSON test file, this is a 2% reduction in time.

Test file is package-lock.json from
91b378e1fa
2022-02-06 23:53:35 +07:00
Wilfred Hughes f3faf3ebaf Reuse string slices rather than allocating new ones
This is a very small performance win on large textual diffs (0.2%).
2022-02-06 23:18:37 +07:00
Wilfred Hughes 67d296c47d Improve wording for textual diffing headers 2022-02-06 17:27:00 +07:00
Wilfred Hughes dd85457b5e Move options parsing into a separate file 2022-02-06 16:58:07 +07:00
Wilfred Hughes d0ce2baf14 Rename MatchKind variants to not assume comments 2022-02-06 16:50:57 +07:00
Wilfred Hughes 6a056e3630 Ensure textual diffs aren't highlighted as comments 2022-02-06 16:48:12 +07:00
Wilfred Hughes e2832dabb3 Set a maximum size on syntactic diffing, and use line diffing otherwise
Fixes #82
2022-02-06 16:38:55 +07:00
Wilfred Hughes da05d6e69d Use italics for comments 2022-02-06 15:06:35 +07:00
Wilfred Hughes 80ed279bb5 Run cargo-flamegraph with debug symbols 2022-02-06 14:39:55 +07:00
Wilfred Hughes d81b774621 Remove unused arguments 2022-02-06 14:37:22 +07:00
Wilfred Hughes 1873267ffa Prefer full module names when calling similar functions 2022-02-06 14:31:03 +07:00
Wilfred Hughes b1b5e7d12c Roll year 2022-02-05 15:58:45 +07:00
Wilfred Hughes a3055083c1 Highlight JS keyword in TS files
Fixes #126
2022-02-05 13:40:45 +07:00
Wilfred Hughes 9e48b64d2c Add a --missing-as-empty flag to allow non-existent paths
By default, difftastic now errors if paths don't exist.
2022-02-03 21:26:51 +07:00
Wilfred Hughes 635ef12f84 Clarify why we return early 2022-02-03 21:05:54 +07:00
Wilfred Hughes 0dcb76eec1 Report whether a binary file has changed
Fixes #119
2022-02-03 21:03:50 +07:00
Wilfred Hughes 3e9d506256 Highlight built-in constants too 2022-02-03 00:27:35 +07:00
Wilfred Hughes 9a630bc01b Expand hack highlighting query 2022-02-03 00:26:44 +07:00
Wilfred Hughes 7e7a4131f0 Configure atom nodes for Hack 2022-02-02 23:42:26 +07:00
Wilfred Hughes d0f8b49df1 Add basic syntax highlighting for Hack 2022-02-02 23:39:00 +07:00
Wilfred Hughes 3400a97a9d Add Scala to introduction in manual 2022-02-02 23:24:50 +07:00
Wilfred Hughes 726bdd8301 Fix duplicate function call from bad copy-pasting 2022-02-02 23:24:24 +07:00
Wilfred Hughes 43605bd5e8 Add support for Hack 2022-02-02 23:22:15 +07:00
Wilfred Hughes 22813808fe Add 'vendor/tree-sitter-hack/' from commit '4770eb21a36307c156cfd2555ddd8e10c304fdc3'
git-subtree-dir: vendor/tree-sitter-hack
git-subtree-mainline: 73c12d2b04
git-subtree-split: 4770eb21a3
2022-02-02 23:11:29 +07:00
Wilfred Hughes 73c12d2b04 Syntax highlight comments in Clojure and Common Lisp
These don't mark their comments as 'extra', but use the node kind
"comment" so it's easy to detect them.
2022-02-02 23:10:06 +07:00
Wilfred Hughes 27877e24f8 Test comment highlighting in Scala
Turns out that we don't need queries for comments, as we're already
using the is_extra() method for both parsing and highlighting.

Closes #120
2022-02-02 23:07:25 +07:00
Wilfred Hughes 34a1946197 Add sample clojure files 2022-02-02 23:07:11 +07:00
Wilfred Hughes 0eba3ecabe Update to the latest tree-sitter version
This is also a minor performance improvement (e.g. saves 1.3% time on
typing_old/new.ml or 3% on elisp_before/after.el).
2022-01-31 22:37:05 +07:00
Wilfred Hughes d1aa1d4925 Line up additions and removals if they affect more than one line 2022-01-31 22:23:58 +07:00
Wilfred Hughes 92c3836672 Clarify variable name 2022-01-31 22:20:14 +07:00
Wilfred Hughes 092b238fbd Prefer passing slices over vecs 2022-01-31 21:51:38 +07:00
Wilfred Hughes 7655ce069b Add a unit test for compact_gaps 2022-01-31 21:49:25 +07:00
Wilfred Hughes 52ef67ccbd Treat quoted_string in OCaml as an atom
Fixes #117
2022-01-31 21:41:53 +07:00
Wilfred Hughes 2f3db76bf8 Integration is adequate now
Git and Mercurial support is sufficient for most use cases, although
other git clients (e.g. magit) have no support yet.
2022-01-30 22:59:49 +07:00
Wilfred Hughes 5d34df3f33 cargo fmt 2022-01-30 22:58:38 +07:00
Wilfred Hughes 4d3fac20d9 Next release will be 0.19 2022-01-30 22:58:22 +07:00
Wilfred Hughes 8f6b269492 Tag a 0.18.1 release 2022-01-30 22:56:19 +07:00
Wilfred Hughes 01d6cb149f Fix compilation on Rust 1.54 2022-01-30 22:54:02 +07:00
Wilfred Hughes 3c05d979ba Add a helper script for doing releases 2022-01-30 18:04:03 +07:00
Wilfred Hughes 409f7aae75 Roll version 2022-01-30 18:03:45 +07:00
Wilfred Hughes 9b77d07e93 Store novel lines on hunks
This allows us to recognise lines that have only additions or only
removals, even if we've managed to find a matching opposite line.

Fixes #115
2022-01-30 17:53:13 +07:00
Wilfred Hughes ea24dd8784 Skip unchanged delim and find a fixpoint
This lets us discard more nodes before diffing, improving performance.

Fixes #84
2022-01-30 17:20:24 +07:00
Wilfred Hughes ad6898fdde Remove node detachment logic
We now only init the next/prev nodes for possibly changed nodes, so
this work is unnecessary.
2022-01-30 14:28:38 +07:00