martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
7.24k stars 240 forks source link

diff: underline added/removed parts by default #3960

Closed jonathantanmy closed 1 week ago

jonathantanmy commented 1 week ago

This helps better visualize changes that contain leading and/or trailing whitespace.

It looks like this: (hmm...maybe the underlines would be confused with underscores)

Screenshot from 2024-06-25 09-20-44

Checklist

If applicable:

jonathantanmy commented 1 week ago

Thanks @PhilipMetzger .

emilazy commented 1 week ago

I like this (I currently pass --git all the time because the default diff format output feels too ambiguous, esp. with regards to whitespace). The underscore ambiguity seems limited; any added or removed underscore would also receive the underline, so I imagine users would catch on quickly. I guess some terminal emulators and fonts might draw the underline at the same place as an underscore?

yuja commented 1 week ago

Just to be sure, this also affects diff --git output.

martinvonz commented 1 week ago

Just to be sure, this also affects diff --git output.

Oh, good catch! I don't think we want that.

martinvonz commented 1 week ago

3965 should fix