jonas / tig

Text-mode interface for git
https://jonas.github.io/tig/
GNU General Public License v2.0
12.41k stars 607 forks source link

Word diff doesn't work for unstaged changes #1207

Closed majutsushi closed 2 years ago

majutsushi commented 2 years ago

When enabling the word-diff option the diffs of normal commits are displayed as expected, with the changed words highlighted. However when looking at unstaged changes in the stage view, the highlighting completely disappears instead, not even line-wise highlighting is shown. Since the stage view is one of the most useful places to have word diffs it would be great if that could be supported as well.

koutcher commented 2 years ago

Good catch. This will be easy to fix, however note that you won't be able to stage chunks (with u) when viewing word-diff as the patch is required for this.

majutsushi commented 2 years ago

That's okay, it's easy enough to switch between modes with a keyboard shortcut. I wonder if it would be possible to change the u behaviour to switch modes automatically before and after applying a patch, but that may be too tricky to get right.