Skip to content

Commit 978904b

Browse files
stefanhallerpaulusmack
authored andcommitted
gitk: When searching, only highlight files when in Patch mode
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent ce837c9 commit 978904b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

gitk

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7979,8 +7979,9 @@ proc highlightfile {cline} {
79797979
}
79807980

79817981
proc highlightfile_for_scrollpos {topidx} {
7982-
global difffilestart
7982+
global cmitmode difffilestart
79837983

7984+
if {$cmitmode eq "tree"} return
79847985
if {![info exists difffilestart]} return
79857986

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

8207-
if {$cmitmode ne "tree"} {
8208-
set topidx [$ctext index @0,0]
8209-
if {![info exists suppress_highlighting_file_for_this_scrollpos]
8210-
|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
8211-
highlightfile_for_scrollpos $topidx
8212-
}
8208+
set topidx [$ctext index @0,0]
8209+
if {![info exists suppress_highlighting_file_for_this_scrollpos]
8210+
|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
8211+
highlightfile_for_scrollpos $topidx
82138212
}
82148213

82158214
catch {unset suppress_highlighting_file_for_this_scrollpos}

0 commit comments

Comments
 (0)