diff options
Diffstat (limited to 'gitk-git/gitk')
| -rwxr-xr-x | gitk-git/gitk | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gitk-git/gitk b/gitk-git/gitk index 91b16a3bb0..831e2e0178 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -1906,6 +1906,7 @@ proc readcommit {id} { proc parsecommit {id contents listed} { global commitinfo + global no_indent set inhdr 1 set comment {} @@ -1949,11 +1950,22 @@ proc parsecommit {id contents listed} { # if we got this via git cat-file, add the indentation set newcomment {} foreach line [split $comment "\n"] { - append newcomment " " + if {!$no_indent} { + append newcomment " " + } append newcomment $line append newcomment "\n" } set comment $newcomment + } else { + if {$no_indent} { + set newcomment {} + foreach line [split $comment "\n"] { + append newcomment [string range $line 4 end] + append newcomment "\n" + } + set comment $newcomment + } } set hasnote [string first "\nNotes:\n" $contents] set diff "" @@ -11794,6 +11806,10 @@ proc prefspage_general {notebook} { grid x $page.webbrowserl $page.webbrowser -sticky ew grid configure $page.webbrowser -padx {0 5} + ttk::checkbutton $page.no_indent -variable no_indent \ + -text [mc "Remove indentation on comment"] + grid x $page.no_indent -sticky w + grid columnconfigure $page 2 -weight 1 return $page @@ -12097,6 +12113,7 @@ proc prefsok {} { global oldprefs prefstop fontpref treediffs global {*}$::config_variables global ctext + global no_indent catch {destroy $prefstop} unset prefstop @@ -12151,6 +12168,9 @@ proc prefsok {} { if {$wrapdefault != $oldprefs(wrapdefault)} { $ctext configure -wrap $wrapdefault } + if {$no_indent != $oldprefs(no_indent)} { + reloadcommits + } } proc formatdate {d} { @@ -12658,6 +12678,7 @@ set autocopy 0 set autoselect 1 set autosellen $hashlength set perfile_attrs 0 +set no_indent 0 if {[tk windowingsystem] eq "aqua"} { set extdifftool "opendiff" @@ -12787,6 +12808,7 @@ set config_variables { maxrefs maxwidth mergecolors + no_indent perfile_attrs reflinecolor refstohide @@ -13033,3 +13055,4 @@ getcommits {} # indent-tabs-mode: t # tab-width: 8 # End: +# vim: ts=4 expandtab |
