summaryrefslogtreecommitdiff
path: root/git-gui/lib/diff.tcl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-04-19 01:35:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-04-19 01:35:48 (GMT)
commit1eb0545cce4a4ed652425798b87cb0e777c03b3f (patch)
treefc20c82e2f05a9d6f510481b8eeb3481054975bc /git-gui/lib/diff.tcl
parent3d6bc9a763f56156b424e7382b4029a67a49847e (diff)
parent4498b3a50a0e839788682f672df267cbc1ba9292 (diff)
downloadgit-1eb0545cce4a4ed652425798b87cb0e777c03b3f.zip
git-1eb0545cce4a4ed652425798b87cb0e777c03b3f.tar.gz
git-1eb0545cce4a4ed652425798b87cb0e777c03b3f.tar.bz2
Merge tag 'gitgui-0.20.0' of http://repo.or.cz/r/git-gui
git-gui 0.20.0 * tag 'gitgui-0.20.0' of http://repo.or.cz/r/git-gui: git-gui: set version 0.20 git-gui: sv.po: Update Swedish translation (547t0f0u) git-gui i18n: Updated Bulgarian translation (547t,0f,0u) git-gui: Makes chooser set 'gitdir' to the resolved path git-gui: Fixes chooser not accepting gitfiles git-gui: reinstate support for Tcl 8.4 git-gui: fix problem with gui.maxfilesdisplayed git-gui: fix verbose loading when git path contains spaces. git-gui/gitk: Do not depend on Cygwin's "kill" command on Windows git-gui: add configurable tab size to the diff view git-gui: Make git-gui lib dir configurable at runime git-gui i18n: Updated Bulgarian translation (520t,0f,0u) L10n: vi.po (543t): Init translation for Vietnamese git-gui: align the new recursive checkbox with the radiobuttons. git-gui: Add a 'recursive' checkbox in the clone menu.
Diffstat (limited to 'git-gui/lib/diff.tcl')
-rw-r--r--git-gui/lib/diff.tcl20
1 files changed, 19 insertions, 1 deletions
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index b0a5180..0d56986 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -1,6 +1,19 @@
# git-gui diff viewer
# Copyright (C) 2006, 2007 Shawn Pearce
+proc apply_tab_size {{firsttab {}}} {
+ global have_tk85 repo_config ui_diff
+
+ set w [font measure font_diff "0"]
+ if {$have_tk85 && $firsttab != 0} {
+ $ui_diff configure -tabs [list [expr {$firsttab * $w}] [expr {($firsttab + $repo_config(gui.tabsize)) * $w}]]
+ } elseif {$have_tk85 || $repo_config(gui.tabsize) != 8} {
+ $ui_diff configure -tabs [expr {$repo_config(gui.tabsize) * $w}]
+ } else {
+ $ui_diff configure -tabs {}
+ }
+}
+
proc clear_diff {} {
global ui_diff current_diff_path current_diff_header
global ui_index ui_workdir
@@ -105,6 +118,8 @@ proc show_diff {path w {lno {}} {scroll_pos {}} {callback {}}} {
set cont_info [list $scroll_pos $callback]
+ apply_tab_size 0
+
if {[string first {U} $m] >= 0} {
merge_load_stages $path [list show_unmerged_diff $cont_info]
} elseif {$m eq {_O}} {
@@ -401,7 +416,10 @@ proc read_diff {fd conflict_size cont_info} {
# -- Automatically detect if this is a 3 way diff.
#
- if {[string match {@@@ *} $line]} {set is_3way_diff 1}
+ if {[string match {@@@ *} $line]} {
+ set is_3way_diff 1
+ apply_tab_size 1
+ }
if {$::current_diff_inheader} {