Commit Graph

6693 Commits (f00b921de528b3455733598f8a796c5475a985ef)
 

Author SHA1 Message Date
Wilfred Hughes 153feb2b8c Silencing more warnings 2021-11-02 23:35:43 +07:00
Wilfred Hughes a8b63f70cf Fix another warning and now hunk printing works as expected 2021-11-02 23:35:43 +07:00
Wilfred Hughes 66d0a7cce8 Ensure lines seen HashSet stays up-to-date 2021-11-02 23:35:43 +07:00
Wilfred Hughes a8ba1be7d2 Remove unused code 2021-11-02 23:35:43 +07:00
Wilfred Hughes 412a947b09 Enforce lines are contiguous -- hunks largely work!
Some repeated lines in load_before/after.js though.
2021-11-02 23:35:43 +07:00
Wilfred Hughes f36f5bd7af Don't discard closest context line 2021-11-02 23:35:43 +07:00
Wilfred Hughes 46d96a5c9c Hook up new hunk merging logic 2021-11-02 23:35:43 +07:00
Wilfred Hughes 61d2767bbe Don't compact hunks where only one side has changes 2021-11-02 23:35:43 +07:00
Wilfred Hughes 56dfa4b10b Implement compact_gaps 2021-11-02 23:35:43 +07:00
Wilfred Hughes 04392f5e0f Hooking together hunk alignment logic 2021-11-02 23:35:43 +07:00
Wilfred Hughes fbfcc2529d cargo fmt 2021-11-02 23:35:43 +07:00
Wilfred Hughes 346d757810 Treat max_distance as a constant 2021-11-02 23:35:43 +07:00
Wilfred Hughes c59c36bc15 Add todo 2021-11-02 23:35:43 +07:00
Wilfred Hughes a46c2ff31b Add a fill_gaps helper 2021-11-02 23:35:43 +07:00
Wilfred Hughes 5473569a03 Add a fill_aligned helper 2021-11-02 23:35:43 +07:00
Wilfred Hughes 4549847a30 Minimise spacing between columns of line numbers when there's a single side 2021-11-02 23:35:43 +07:00
Wilfred Hughes 75533335cb Merge adjacent hunks 2021-11-02 23:35:43 +07:00
Wilfred Hughes 90be1c3a84 Remove unused params 2021-11-02 23:35:43 +07:00
Wilfred Hughes de4b81689d cargo fmt 2021-11-02 23:35:43 +07:00
Wilfred Hughes 54571a0939 Fix build 2021-11-02 23:35:43 +07:00
Wilfred Hughes 31f8b66243 Collapse the unchanged side if a hunk is exclusively adds/removes 2021-11-02 23:35:43 +07:00
Wilfred Hughes f4fc799b40 Render line numbers properly in hunks 2021-11-02 23:35:43 +07:00
Wilfred Hughes 5c676b1bec Print source with hunks 2021-11-02 23:35:43 +07:00
Wilfred Hughes e1cb9fa94e Hooking up more of hunk line processing 2021-11-02 23:35:43 +07:00
Wilfred Hughes 3bf5fe05ba Fix context to not reuse previous lines 2021-11-02 23:35:43 +07:00
Wilfred Hughes 711e694d4d Improve alignment when printing hunk lines 2021-11-02 23:35:43 +07:00
Wilfred Hughes b1d2d5185e Fix left/right confusion in context calculations 2021-11-02 23:35:43 +07:00
Wilfred Hughes e7b416a205 Use context functions rather than the previous extend ones 2021-11-02 23:35:43 +07:00
Wilfred Hughes 637b13488d Finish basic context implementation 2021-11-02 23:35:43 +07:00
Wilfred Hughes 48d69a2332 Implement before_with_opposites 2021-11-02 23:35:43 +07:00
Wilfred Hughes b117bd69c1 Extract opposite lines from a slice of MatchedPos 2021-11-02 23:35:43 +07:00
Wilfred Hughes 400b54d97a Store a tuple in self_pos 2021-11-02 23:35:43 +07:00
Wilfred Hughes 0769a6bf3c Store self_pos on UnchangedCommentPart 2021-11-02 23:35:43 +07:00
Wilfred Hughes 75ff659bc5 Store self_pos on Unchanged matches 2021-11-02 23:35:43 +07:00
Wilfred Hughes 337c877a97 Don't use prev_opposite_pos in hunk calculations 2021-11-02 23:35:43 +07:00
Wilfred Hughes 4e5dc2b6bd Basic hunk line extraction 2021-11-02 23:35:43 +07:00
Wilfred Hughes 3efa77c43e Add example of a single line changing in a block comment 2021-11-02 23:23:37 +07:00
Wilfred Hughes a87882c0a3 Increase required rust version
radix-heap uses macros for built-in arguments, which was added in Rust
1.54:
https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1540-2021-07-29
2021-10-30 12:46:42 +07:00
Wilfred Hughes 1f39284127 Clarify that link points to GitHub 2021-10-29 00:22:55 +07:00
Wilfred Hughes c0cd13bd9b Pin Rust version to 1.46
Specify the minimum Rust version in cargo.toml, exercise this version in CI,
and document it in the manual.

We require 1.46 for bitflags, which is a dependency of clap.

Fixes #51
2021-10-29 00:20:07 +07:00
Wilfred Hughes 86724658c0 Update radix-heap version
This avoids us depending on an old version of ordered_float, which has
a security advisory: https://rustsec.org/advisories/RUSTSEC-2020-0082

It also slightly reduces the number of dependencies of difftastic.
2021-10-28 00:51:37 +07:00
Wilfred Hughes 0f8a2d3672 Highlight line numbers for lines with changes 2021-10-28 00:21:45 +07:00
Wilfred Hughes c23a36411d Only use bold for keywords in novel tokens
This makes added/removed regions slightly less prominent, but easier
to read. It also makes them more consistent with the styling on the
surrounding text.
2021-10-27 23:55:33 +07:00
Wilfred Hughes 9df3089199 Fix typo 2021-10-27 23:39:42 +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 b3106e1382 Print file name and hunk number on every hunk 2021-10-23 16:52:49 +07:00
Wilfred Hughes 5e9a0eec5d Rename JSON files to match sample file naming convention 2021-10-23 16:24:54 +07:00
Wilfred Hughes c698f8979b Rename binary to `difft` for brevity 2021-10-23 16:19:33 +07:00
Wilfred Hughes 5c3f95ae29 Log CLI arguments
This is really helpful when debugging corner cases with git/mercurial
calling difftastic.
2021-10-23 16:08:16 +07:00
Wilfred Hughes aa65b20665 Bump dependencies 2021-10-23 15:43:18 +07:00