Wilfred Hughes
e404c0e86f
Ensure we only calculate opposite positions once
...
Previously this was computed per-hunk, which was wasteful and slow
when there are many hunks.
2022-01-14 09:48:40 +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
0769a6bf3c
Store self_pos on UnchangedCommentPart
2021-11-02 23:35:43 +07:00
Wilfred Hughes
5349571ad7
Only store prev_opposite_pos on novel positions
...
This is much easier to reason about, rather than overloading
opposite_pos and prev_opposite_pos.
2021-10-23 21:26:46 +07:00
Wilfred Hughes
2640cbc101
Store only SingleLineSpan in MatchedPos
...
Positions almost always span a single line, as they just track
tokens. The only exception is multiline strings or comments.
Trying to match up all the lines between two tokens is far more
complex and doesn't provide much benefit. It was already the case that
we used the first line in the position in several code paths anyway.
2021-10-16 21:38:02 +07:00
Wilfred Hughes
058b9e3c12
Expand module docs
2021-09-14 00:07:28 +07:00
Wilfred Hughes
42425532c7
Use reversed positions after computing them
2021-08-07 16:40:32 +07:00
Wilfred Hughes
bbb0f2fcba
Store opposite position on unchanged matched positions
2021-08-07 16:14:16 +07:00
Wilfred Hughes
d07b97a3ec
More inline diff context fixes
2021-08-04 23:49:07 +07:00
Wilfred Hughes
2dcb265d76
Inline diff: correct line number for RHS trailing context
2021-08-04 23:40:03 +07:00
Wilfred Hughes
cebd377163
Apply inline colours to inline diff
2021-08-04 23:36:09 +07:00
Wilfred Hughes
c39b2677e0
Tweak whitespace in inline diff
2021-08-04 23:30:38 +07:00
Wilfred Hughes
85fae3cfe9
Inline display: print RHS context after changed lines
2021-08-04 23:30:13 +07:00
Wilfred Hughes
01b5197b0a
Adding context boundary calculations to inline display
2021-08-03 23:59:40 +07:00
Wilfred Hughes
f2629abe2c
Experimenting with colouring line numbers based on LHS/RHS modified state
2021-08-01 23:55:24 +07:00
Wilfred Hughes
cc77dae1f0
Silence clippy warning
2021-08-01 23:27:32 +07:00
Wilfred Hughes
07605434cc
Use bold for inline display for consistency with side-by-side
2021-08-01 17:05:05 +07:00
Wilfred Hughes
d3c50a7a09
Don't display RHS lines before the first change of a hunk
2021-08-01 17:03:38 +07:00
Wilfred Hughes
83a840869c
Initial red/green printing of changed lines for inline display
2021-08-01 16:40:07 +07:00
Wilfred Hughes
8c97fc2484
Pad groups in both modes and print lines of content in inline mode
2021-08-01 16:26:18 +07:00
Wilfred Hughes
c46ef92cd5
Stub implementation for inline display
2021-08-01 16:12:44 +07:00
Wilfred Hughes
af7fdadf26
Define an inline diff module
2021-08-01 16:07:45 +07:00