gitk: Fix the tab setting in the diff display window
commit32f1b3e4a4baa3fe3e1acbb75f8134d822a09d58
authorPaul Mackerras <paulus@samba.org>
Fri, 28 Sep 2007 11:27:39 +0000 (28 21:27 +1000)
committerPaul Mackerras <paulus@samba.org>
Fri, 28 Sep 2007 11:27:39 +0000 (28 21:27 +1000)
tree5894a31cdb4d87e6c6419d37e06e103e7c0eefa9
parentbb3edc8b0473192da11bf7f9e961ea0fcc444c63
gitk: Fix the tab setting in the diff display window

This fixes the bug where we were using the wrong font to calculate
the width of the tab stops in the diff display window.

If we're running on Tk 8.5 we also use the new -tabstyle wordprocessor
option that makes tabs work as expected, i.e. a tab moves the cursor
to the right until the next tab stop is reached.  On Tk 8.5 we also
get fancy and set the first tab stop at column 1 for a normal diff
or column N for a merge diff with N parents.

On Tk8.4 we can't do that because the tabs work in the "tabular"
style, i.e. the nth tab character moves to the location of the nth
tab position, *unless* you ask for the default tab setting, which
gives 8-column tabs that work in the "wordprocessor" mode.  So on
Tk8.4 if the tab setting is 8 we ask for default tabs.  This means
that a tab setting of 7 or 9 can look quite different to 8 in some
cases.

Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk