Commit Graph

6966 Commits (447ed2c14dd1946b6e92930c9b1eb89014fff61f)
 

Author SHA1 Message Date
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
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