Skip to content

Commit

Permalink
gitk: When searching, only highlight files when in Patch mode
Browse files Browse the repository at this point in the history
This fixes another regression that was introduced in b967135 ("gitk:
Synchronize highlighting in file view when scrolling diff"): when
searching for a string in tree mode, jumping to the next search hit
would highlight the "Comments" entry in the file list.

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Stefan Haller authored and Paul Mackerras committed Oct 21, 2012
1 parent ce837c9 commit 978904b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -7979,8 +7979,9 @@ proc highlightfile {cline} {
}

proc highlightfile_for_scrollpos {topidx} {
global difffilestart
global cmitmode difffilestart

if {$cmitmode eq "tree"} return
if {![info exists difffilestart]} return

set top [lindex [split $topidx .] 0]
Expand Down Expand Up @@ -8204,12 +8205,10 @@ proc scrolltext {f0 f1} {
global searchstring cmitmode ctext
global suppress_highlighting_file_for_this_scrollpos

if {$cmitmode ne "tree"} {
set topidx [$ctext index @0,0]
if {![info exists suppress_highlighting_file_for_this_scrollpos]
|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
highlightfile_for_scrollpos $topidx
}
set topidx [$ctext index @0,0]
if {![info exists suppress_highlighting_file_for_this_scrollpos]
|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
highlightfile_for_scrollpos $topidx
}

catch {unset suppress_highlighting_file_for_this_scrollpos}
Expand Down

0 comments on commit 978904b

Please sign in to comment.