Commit 861705f
committed
diff: add --slide-down option to shift ambiguous hunks downward
When an inserted block is bounded by lines identical to the
surrounding context (e.g., "}") the diff slider can place
the hunk at any position within the slidable range.
Add --slide-down (and diff.slideDown config) to leave ambiguous hunks
at the furthest-down position, so that insertions appear appended
after the existing context rather than prepended before it. This
results in a more readable git diff, without adding any extra lines
to the diff.
Signed-off-by: Charles G Waldman <cgw@alum.mit.edu>1 parent 7ff1e8d commit 861705f
3 files changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
289 | 290 | | |
290 | 291 | | |
291 | 292 | | |
| 293 | + | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| |||
4861 | 4864 | | |
4862 | 4865 | | |
4863 | 4866 | | |
| 4867 | + | |
| 4868 | + | |
4864 | 4869 | | |
4865 | 4870 | | |
4866 | 4871 | | |
| |||
5910 | 5915 | | |
5911 | 5916 | | |
5912 | 5917 | | |
| 5918 | + | |
| 5919 | + | |
| 5920 | + | |
5913 | 5921 | | |
5914 | 5922 | | |
5915 | 5923 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
860 | 869 | | |
861 | 870 | | |
862 | 871 | | |
| |||
0 commit comments