Commit Graph

7349 Commits (1b907e84c1f9b6a17b9fb62e996213ba62b10d77)
 

Author SHA1 Message Date
Wilfred Hughes 1b907e84c1 Fix character literals in Lisp
Improves #85
2022-01-27 21:53:21 +07:00
Wilfred Hughes 5cf143228f Treat attribute IDs in OCaml as atoms
Fixes #114
2022-01-27 20:25:17 +07:00
Wilfred Hughes bde1009825 Factor out a line tuple comparison helper 2022-01-26 22:38:46 +07:00
Wilfred Hughes bf5d9b6192 Print header on every hunk in inline display
See #34
2022-01-26 22:05:52 +07:00
Wilfred Hughes 6fb800606e Get all matched lines and then slice
This is much simpler conceptually and less prone to bugs.

Fixes #111
2022-01-26 21:58:02 +07:00
Wilfred Hughes cb510375c1 Show ChangedCommentPart in bold 2022-01-25 22:55:30 +07:00
Wilfred Hughes 69dbad35ad Roll version 2022-01-25 22:32:18 +07:00
Wilfred Hughes e123cad49e Only set next/prev on potentially changed syntax nodes
Otherwise we end up running dijkstra on nodes at the end that we've
already marked as unchanged, and erroneously claim they're novel.

Fixes #112
2022-01-25 22:29:19 +07:00
Wilfred Hughes 440c94ce3c Don't treat identical text files as binary
Looks like a copy-paste mistake.
2022-01-24 20:34:34 +07:00
Wilfred Hughes 1a26441c52 Adjust syntax highlighting colours
Blue is a little dark in some dark themes, meaning the contrast is
sometimes too low.

Closes #108
2022-01-24 19:39:46 +07:00
Wilfred Hughes af52cc060f Suggest a pager and an alias with difftool
Suggested in #29
2022-01-24 09:29:18 +07:00
Wilfred Hughes 10ff7d0a82 Don't dim unstyled text
There doesn't seem to be a visual difference (at least in my
terminal), and we should probably never dim content we're showing to
the user.
2022-01-23 12:25:53 +07:00
Wilfred Hughes 5b2f348dfa Highlight novel type atoms as bold too
This makes highlighting consistent across changed/unchanged lines.
2022-01-23 12:20:29 +07:00
Wilfred Hughes f053529f76 Use bold for highlighting types too
Too many colours makes it harder to spot the red/green changed
sections, but it's nice seeing types distinctly.

This is probably the limit of syntax highlighting possible within the
current design, so consider #32 done for the time being.

Fixes #32
2022-01-23 11:56:27 +07:00
Wilfred Hughes d594901d29 Factor out a struct for tracking highlighting IDs 2022-01-23 11:38:37 +07:00
Wilfred Hughes a5de97a63c Add syntax highlighting for strings
Improves #32.
2022-01-23 11:27:29 +07:00
Wilfred Hughes 637eee8ff1 cargo fmt 2022-01-23 11:13:20 +07:00
Wilfred Hughes e63eb43c7b Tweak variable names 2022-01-23 11:13:05 +07:00
Wilfred Hughes 6ff60bf0c5 Add syntax highlighting on comments
Improves #32
2022-01-23 11:07:16 +07:00
Wilfred Hughes 119217e900 Factor out error highlighting as an explicit helper 2022-01-23 10:58:31 +07:00
Wilfred Hughes 28440a2a29 Display changed delimiters in bold
This is really helpful when changing a small part of a larger
expression, where only a single delimiter has changed.
2022-01-23 10:49:42 +07:00
Wilfred Hughes ff52941131 Remove duplicate style calculation logic 2022-01-22 22:50:24 +07:00
Wilfred Hughes 94e968b660 Ignore unchanged nodes at the start/end of the file
This is the first part of #84.
2022-01-22 22:26:52 +07:00
Wilfred Hughes a2dc0b5109 Roll version 2022-01-22 19:03:58 +07:00
Wilfred Hughes 4e33a0c4bc Add a benchmarking example of a larger file 2022-01-22 18:59:32 +07:00
Wilfred Hughes fb680ccdb3 Document diffing directories
Also add sample directories to exercise this.

Helps with #98.
2022-01-22 18:58:04 +07:00
Wilfred Hughes 61c79839e3 Ensure we always include the first and last hunk line
Fixes #90
2022-01-22 18:46:55 +07:00
Wilfred Hughes f33c88a274 Remove leftover dbg! 2022-01-22 17:58:27 +07:00
Wilfred Hughes de89caadb3 Don't consider newlines to be words in the line parser
This causes us to match up unrelated lines, and doesn't make sense for
a line parser.

Improves #90.
2022-01-22 17:56:12 +07:00
Wilfred Hughes e060ab31bf Fix another bug with duplicate line printing
hunk_end needs flipping when operating on the mirror image, as well as
the output.
2022-01-22 17:16:23 +07:00
Wilfred Hughes e2bf7741a0 Fix .max_line() when source has a trailing newline
Fixes a crash when testing #90 against trunk.
2022-01-22 13:40:12 +07:00
Wilfred Hughes 504221b908 Fix lint warning 2022-01-22 13:19:14 +07:00
Wilfred Hughes cb7122c937 Take an opposite line whenver possible when matching novel regions
Fixes #99
2022-01-22 13:16:33 +07:00
Wilfred Hughes 68d60f076c Fix wording in manual 2022-01-22 11:26:55 +07:00
Wilfred Hughes f9ac4411f5 Clarify unique_id semantics 2022-01-22 11:22:49 +07:00
Wilfred Hughes c1b08f8e46 cargo fmt 2022-01-21 22:10:39 +07:00
Wilfred Hughes b88ed07dc2 Update changelog 2022-01-21 21:42:34 +07:00
Wilfred Hughes b30f203c99 Merge branch 'faster_dijkstra' 2022-01-21 21:40:19 +07:00
Wilfred Hughes 3548c32a4c Fix sliders after diffing
Fixes #35
2022-01-21 21:39:02 +07:00
Wilfred Hughes 6df0d12c3e Add accessor for node change 2022-01-20 23:26:17 +07:00
Wilfred Hughes d0c15f6cd2 Add TODO 2022-01-20 23:13:06 +07:00
Wilfred Hughes b136369fd7 Revert "Prefer novel tokens on the same line, even if there are repeats"
This reverts commit 37a18401c6.
2022-01-20 19:12:52 +07:00
Wilfred Hughes ef99974c97 Don't track prev_is_novel in graph 2022-01-20 19:12:52 +07:00
Wilfred Hughes 97bcbfaca5 Binary search in NewlinePositions
This function is hot when converting tree-sitter ASTs to difftastic
ASTs, so it's a performance win.
2022-01-20 19:12:02 +07:00
Wilfred Hughes dc8e52f52a Store line_end directly in NewlinePositions
This saves a second lookup in the positions array, improving
performance considerably. The lookup code is hot.
2022-01-20 19:11:54 +07:00
Wilfred Hughes ff9c272a35
Merge pull request #101 from hugo-vrijswijk/tree-sitter-scala
Add Scala support
2022-01-19 23:19:45 +07:00
Wilfred Hughes d7e01be7a7 Optimise newline splitting
It's faster and simpler to use .split() rather than a regex, and it
still passes all tests.
2022-01-19 23:19:33 +07:00
Hugo van Rijswijk 3eee1e32db Add scala to upstream_parsers.md 2022-01-19 09:09:19 +07:00
Hugo van Rijswijk 407ce4d5b9
Update src/tree_sitter_parser.rs
Co-authored-by: Wilfred Hughes <me@wilfred.me.uk>
2022-01-19 09:03:40 +07:00
Wilfred Hughes 02a25ff251 Improve perf when diffing identical contents
Should help with #98.
2022-01-18 23:34:31 +07:00