Wilfred Hughes
a5965b8292
Update screenshots for 0.12
2021-11-14 17:05:53 +07:00
Wilfred Hughes
d2f73e343c
Document newer haskell parser commit
2021-11-14 16:51:47 +07:00
Wilfred Hughes
987791253c
Merge commit 'd72f2e42c0d5ccf8e8b1c39e3642428317e8fe02'
2021-11-14 16:51:15 +07:00
Wilfred Hughes
546391e9c0
Fix subword highlighting in multiline comments
2021-11-14 16:48:55 +07:00
Wilfred Hughes
6e955793db
Tweak wording on manual intro
2021-11-14 15:29:40 +07:00
Torsten Schmits
d72f2e42c0
skip initial whitespace instead of consuming it ( #48 )
2021-11-14 23:21:37 +07:00
Wilfred Hughes
67bea22434
Rename Java sample file for consistency
2021-11-14 13:34:46 +07:00
Wilfred Hughes
9693d813d2
Document Haskell parser upgrade
2021-11-14 13:27:55 +07:00
Wilfred Hughes
36bb384b82
Merge commit '6668085e7d3dc6205a3ef27e6293988cf4a10419'
2021-11-14 13:25:34 +07:00
Wilfred Hughes
1ad04f10bb
Add a Haskell sample file
2021-11-14 13:18:58 +07:00
Wilfred Hughes
932b4ba0f1
Clarify that changed MatchedPos may be Novel or ChangedCommentPart
2021-11-14 13:13:18 +07:00
Wilfred Hughes
15b6172ed1
Remove unused function
2021-11-14 13:11:16 +07:00
Wilfred Hughes
bc96b702ba
Update screenshot repro commands
2021-11-14 13:11:08 +07:00
Wilfred Hughes
25dae40dfa
Display the file name even when there are no syntactic changes
2021-11-14 13:04:06 +07:00
Wilfred Hughes
8f0603e22b
Merge branch 'truncate_lines'
2021-11-14 13:02:56 +07:00
Wilfred Hughes
4e622e10f7
Update previous line numbers even with single-side display
2021-11-14 12:51:18 +07:00
Wilfred Hughes
0e543a3feb
Reduce padding to use horizontal space more effectively
2021-11-14 12:51:18 +07:00
Wilfred Hughes
2125d12fcf
Factor out width calculation and compute it per-hunk
2021-11-14 12:51:17 +07:00
Wilfred Hughes
410f60c845
Factor out string line number munging
2021-11-14 12:50:38 +07:00
Wilfred Hughes
d050b92158
Collapse the unchanged side if a hunk is exclusively adds/removes
2021-11-14 12:45:36 +07:00
Wilfred Hughes
21ac5f012f
Line truncation/reflowing WIP
2021-11-14 12:45:36 +07:00
Wilfred Hughes
af170a90ba
Don't sort lines when merging hunks
...
They should already be in MatchedPos order, so sorting by line number
breaks that.
2021-11-14 12:44:46 +07:00
Wilfred Hughes
23b9092bd6
Add sample file pair that has shown a ton of hunk merging bugs
2021-11-14 11:49:37 +07:00
Wilfred Hughes
22a4acef15
Increase context to three lines
...
This matches the default in other diff tools.
Also increase the gap to increase the likelihood of merging adjacent
hunks.
2021-11-14 10:37:27 +07:00
Wilfred Hughes
0e0ae58fb1
Add a basic unit test for sorted_novel_positions
2021-11-14 10:35:00 +07:00
Wilfred Hughes
4601e0e607
Order novel MatchedPos values based on previous matched values
...
Previously we'd naively sort based on line number, which behaved badly
where there was a large insert at the beginning of one side.
2021-11-13 22:44:07 +07:00
Wilfred Hughes
cbcbbe367d
Factor out first_opposite_span helper
2021-11-13 22:33:33 +07:00
Wilfred Hughes
25345aa078
Don't track prev_opposite_pos in MatchKind
...
It's unecessary and confusing, and opposite_pos on the unchanged nodes
is a better data type.
2021-11-13 14:08:06 +07:00
Wilfred Hughes
999690185d
Prefer a single dot when no line number is available
...
The common case is when we have no preceding lines, so the dots are
occurring before line 1. A single dot looks better in that case.
2021-11-13 10:27:46 +07:00
Wilfred Hughes
2390cf0391
Move hunk merging to hunks.rs
2021-11-13 10:10:08 +07:00
Torsten Schmits
6668085e7d
allow % before closing parenthesis 🙈
2021-11-08 00:39:03 +07:00
Torsten Schmits
e4b0a016af
allow % before closing parenthesis
2021-11-08 00:30:10 +07:00
Torsten Schmits
717c81741d
allow % before closing parenthesis
2021-11-08 00:27:59 +07:00
Torsten Schmits
3a4bd97aef
support LinearTypes
2021-11-08 00:18:02 +07:00
Torsten Schmits
701e619466
Fix logic error in comment parser
...
When looking for nested multiline comments, the first character of the
`{-` / `-}` must be consumed to access the second character.
The parser sequence used to be
`if("{-") { nested() } -> advance() -> recurse()`
If only a `{` without a subsequent `-` was encountered, the `advance()`
call was made even though the consumption of the brace already advanced
the lexer.
So in the case of `{{-`, the second brace was skipped by `advance()`,
leading to the next cycle starting at the `-` and therefore ignoring the
nested start of a comment.
2021-11-07 22:56:41 +07:00
Wilfred Hughes
c25452e8bf
Prefer Clone over Copy to make generic functions more general
2021-11-04 00:07:14 +07:00
Wilfred Hughes
1ea33e1f39
Fix unhelpful variable name
2021-11-03 23:47:32 +07:00
Wilfred Hughes
d3b38866a8
Document new hunk logic for display
2021-11-03 00:48:46 +07:00
Wilfred Hughes
7509b8bf30
Remove LineGroup now Hunk is feature complete
2021-11-03 00:43:42 +07:00
Wilfred Hughes
dac14eed0f
Port inline diff formatter to use hunks
2021-11-03 00:33:06 +07:00
Wilfred Hughes
68dba028ac
Move merge_adjacent to difft and push max_line inside the function
2021-11-03 00:15:42 +07:00
Wilfred Hughes
4eac9aa6a0
Remove dead code now we're using hunk display
2021-11-02 23:41:26 +07:00
Wilfred Hughes
c7d34fa4a1
Add single-side display for hunks
2021-11-02 23:37:28 +07:00
Wilfred Hughes
adfe8a8191
Don't create empty MatchedPos values
2021-11-02 23:35:43 +07:00
Wilfred Hughes
2f408c63db
Remove dead code
2021-11-02 23:35:43 +07:00
Wilfred Hughes
57479d76a4
Prefer hunk-based printer
2021-11-02 23:35:43 +07:00
Wilfred Hughes
2a96a0c9c5
Calculate content width accurately for hunks
2021-11-02 23:35:43 +07:00
Wilfred Hughes
e67f87e884
Calculate column widths correctly
2021-11-02 23:35:43 +07:00
Wilfred Hughes
d755b83e63
Fix duplicate implementations of opposite_positions
2021-11-02 23:35:43 +07:00
Wilfred Hughes
eae16c7a1d
Colour line numbers in hunk mode
2021-11-02 23:35:43 +07:00