git/lib
Chris Idema d5139f34ce 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 a43c5f51a4 (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>
2026-01-29 22:34:53 +01:00
..
about.tcl Merge branch 'ml/abandon-old-versions' 2025-07-22 17:37:33 +02:00
blame.tcl git-gui: use -profile tcl8 on encoding conversions 2025-07-31 13:51:03 -04:00
branch.tcl git-gui: do not mix -translation binary and -encoding 2025-07-22 12:32:58 -04:00
branch_checkout.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
branch_create.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
branch_delete.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
branch_rename.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
browser.tcl git-gui: do not mix -translation binary and -encoding 2025-07-22 12:32:58 -04:00
checkout_op.tcl git-gui: assure -eofchar {} on all channels 2025-07-22 12:32:58 -04:00
choose_font.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
choose_repository.tcl Merge branch 'ml/abandon-old-versions' 2025-07-22 17:37:33 +02:00
choose_rev.tcl git-gui: remove EOL translation for gets 2025-07-31 13:50:59 -04:00
chord.tcl git-gui: create a new namespace for chord script evaluation 2020-03-17 18:48:54 +05:30
class.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
commit.tcl Merge branch 'strip-post-hooks' of github.com:orgads/git-gui 2025-08-02 14:45:19 +02:00
console.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
database.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
date.tcl git-gui: Localize commit/author dates when displaying them 2007-09-10 01:54:16 -04:00
diff.tcl git-gui: shift tabstops to account for the first column of patch text 2026-01-29 22:34:53 +01:00
encoding.tcl doc: switch links to https 2024-05-05 16:49:00 +02:00
error.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
git-gui.ico git-gui: Improve the application icon on Windows. 2007-12-02 23:05:10 -05:00
index.tcl git-gui: fix error handling of Revert Changes command 2025-09-01 21:07:57 +02:00
line.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
logo.tcl git-gui: Refactor Henrik Nyh's logo into its own procedure 2007-10-10 01:12:15 -04:00
merge.tcl Merge branch 'ml/abandon-old-versions' 2025-07-22 17:37:33 +02:00
mergetool.tcl git-gui: translation binary defines iso8859-1 2025-07-22 12:32:58 -04:00
meson.build git-gui: wire up support for the Meson build system 2025-05-13 08:48:09 +02:00
option.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
remote.tcl git-gui: git-remote is always available 2025-07-18 23:48:06 -04:00
remote_add.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
remote_branch_delete.tcl git-gui: remove EOL translation for gets 2025-07-31 13:50:59 -04:00
search.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
shortcut.tcl git-gui: use /cmd/git-gui.exe for shortcut 2025-07-22 10:21:44 -04:00
spellcheck.tcl git-gui: assure -eofchar {} on all channels 2025-07-22 12:32:58 -04:00
sshkey.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
status_bar.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
themed.tcl git-gui: themed.tcl: use full namespace for color 2025-07-31 13:51:03 -04:00
tools.tcl Merge branch 'ml/replace-auto-execok' into js/fix-open-exec 2025-05-23 17:04:27 -04:00
tools_dlg.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
transport.tcl git-gui: remove non-ttk code 2025-07-21 11:59:21 -04:00
win32.tcl git-gui: sanitize 'exec' arguments: simple cases 2025-05-23 17:04:23 -04:00
win32_shortcut.js git-gui: Use proper Windows shortcuts instead of bat files 2007-10-12 23:07:58 -04:00