Commit d5139f3
git-gui: shift tabstops to account for the first column of patch text
When reviewing a change before staging, it is desirable to see text after
tabstops aligned the same way as in the text editor. However, since there
is always an additional character in column one in patch text ('+', '-',
or space), the alignment is broken if text before the first tab character
is just long enough to push the stop to the next tab position.
Commit a43c5f5 (git-gui: add configurable tab size to the diff view,
2012-02-12) added infrastructure that manipulates the tabstop positions
of the Tk text widget. However, it does so only when a 3-way diff is
shown and only so that it takes into account the one additional markup at
the beginning of lines. This only achieved that alignment does not get
worse for 3-way diffs compared to regular patch text, but left misaligned
text in regular patch text unmodified.
Use and modify this infrastructure to shift tabstops by one position for
regular patch text and two positions for 3-way diffs. Existing code
already resets the tabstops to an unshifted position when contents of
untracked files are displayed.
Signed-off-by: Chris Idema <github_chris_idema@proton.me>
[j6t: extend commit message]
Signed-off-by: Johannes Sixt <j6t@kdbg.org>1 parent 1a729cc commit d5139f3
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
388 | 390 | | |
389 | 391 | | |
390 | 392 | | |
| |||
0 commit comments