Wilfred Hughes
c80ce0d024
Use vendored tree-sitter-rust
2021-08-15 16:50:43 +07:00
Wilfred Hughes
8a6c7c8013
Add 'vendor/tree-sitter-go/' from commit 'eb306e6e60f393df346cfc8cbfaf52667a37128a'
...
git-subtree-dir: vendor/tree-sitter-go
git-subtree-mainline: 26c6438fa2
git-subtree-split: eb306e6e60
2021-08-15 16:42:25 +07:00
Wilfred Hughes
26c6438fa2
Add 'vendor/tree-sitter-css/' from commit '94e10230939e702b4fa3fa2cb5c3bc7173b95d07'
...
git-subtree-dir: vendor/tree-sitter-css
git-subtree-mainline: e31b5b4925
git-subtree-split: 94e1023093
2021-08-15 16:41:30 +07:00
Wilfred Hughes
e31b5b4925
Add 'vendor/tree-sitter-json/' from commit '65bceef69c3b0f24c0b19ce67d79f57c96e90fcb'
...
git-subtree-dir: vendor/tree-sitter-json
git-subtree-mainline: 59f80c20dd
git-subtree-split: 65bceef69c
2021-08-15 16:41:09 +07:00
Wilfred Hughes
59f80c20dd
Add 'vendor/tree-sitter-rust/' from commit 'a360da0a29a19c281d08295a35ecd0544d2da211'
...
git-subtree-dir: vendor/tree-sitter-rust
git-subtree-mainline: e7a6c3b11e
git-subtree-split: a360da0a29
2021-08-15 16:33:53 +07:00
Wilfred Hughes
e7a6c3b11e
Initial tree-sitter prototype
2021-08-15 16:16:48 +07:00
Wilfred Hughes
70ee1b736e
Fix off-by-one that breaks empty positions at file beginning
2021-08-12 18:33:26 +07:00
Wilfred Hughes
997a2cfb8e
Prefer immutable syntax references
...
It's fine to have mutable aliases when allocating Syntax nodes, but it
triggers clippy lints and forces us to use more explicit type
annotations.
All the data we want to mutate is behind a cell anyway, so prefer the
immutable form.
2021-08-12 18:02:55 +07:00
Wilfred Hughes
330026e6a3
Fix off-by-one in padding calculations
...
Interval is exclusive of `end`, so add 1 to the last line when
initialising.
2021-08-11 23:28:29 +07:00
Wilfred Hughes
e693bffe87
Make column number placeholders more precise
...
Previously we'd always show . for the first unaligned line if it was
the first line in a hunk.
2021-08-11 22:37:37 +07:00
Wilfred Hughes
15110f928f
Store open and close in unchanged positions
2021-08-11 22:26:49 +07:00
Wilfred Hughes
414182c9dd
Only show a single column in side-by-side when adding a whole file
2021-08-08 23:25:26 +07:00
Wilfred Hughes
09a80150df
Fix adding/removing whole files
...
The 'remove unaligned lines at beginning of hunk' logic meant we just
discarded the whole hunk.
This breaks alignment again (previously fixed in 3ebbf268fd ), but that
should be fixed properly in the padding logic.
2021-08-08 23:15:23 +07:00
Wilfred Hughes
15be123b20
Ensure LineGroup does not iterate over extra lines
2021-08-08 22:46:09 +07:00
Wilfred Hughes
2ff7d38ac2
Make clippy happier
2021-08-08 22:26:04 +07:00
Wilfred Hughes
f56ca49747
Pass LineGroup directly to aligned_lines
2021-08-08 20:45:15 +07:00
Wilfred Hughes
3ae0b7df84
Allow RHS to be arbitrarily long in a pager
...
If stdout is not a TTY, assume it's a pager and don't truncate the
RHS.
2021-08-08 17:35:31 +07:00
Wilfred Hughes
857cb77d8f
Ensure LHS and RHS source code are the same width
2021-08-08 17:31:18 +07:00
Wilfred Hughes
83b8c843cb
Use .. for column numbers on blank lines used to align
2021-08-08 11:26:17 +07:00
Wilfred Hughes
ac63677127
Move format_line_num_padded to side_by_side as it's only used there
2021-08-08 11:08:15 +07:00
Wilfred Hughes
1de7c10a56
Fix column number alignments in inline diff mode
2021-08-08 00:43:18 +07:00
Wilfred Hughes
2a905e28bc
Allow storing opposite position on unchanged comment parts
2021-08-08 00:04:05 +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
3a1e34160f
Fix typo
2021-08-07 13:28:55 +07:00
Wilfred Hughes
98e02f2d9d
Move side-by-side logic from lines.rs to side_by_side.rs
2021-08-07 12:27:57 +07:00
Wilfred Hughes
d07b97a3ec
More inline diff context fixes
2021-08-04 23:49:07 +07:00
Wilfred Hughes
a7063c97c7
Allow copying and/or cloning of match information
2021-08-04 23:48:45 +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
cbea00e6a6
Add todo
2021-08-04 23:25:27 +07:00
Wilfred Hughes
c43206624d
cargo fmt
2021-08-04 00:17:07 +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
e9e072af01
Remove completed todo
2021-08-01 16:19:28 +07:00
Wilfred Hughes
f54ef7d477
Add TODO
2021-08-01 16:15:54 +07:00
Wilfred Hughes
4a618f3c16
Prefer LineNumber wrappers when passing line numbers to formatters
2021-08-01 16:14:25 +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
Wilfred Hughes
3e0b3b6d41
Define an environment variable for controlling output format
2021-08-01 16:06:15 +07:00
Wilfred Hughes
ae9df2c55a
Move side-by-side diff display to a separate module
2021-08-01 15:40:47 +07:00
Wilfred Hughes
1ceaecfa25
Remove --width from CLI parameters
...
This is the first step in refactoring for inline diffs.
2021-08-01 15:30:12 +07:00
Wilfred Hughes
7a61048056
Simplify pattern match for edge costs
2021-07-31 23:33:44 +07:00