Skip to content

Commit 30441a6

Browse files
stefanhallerpaulusmack
authored andcommitted
gitk: Highlight first search result immediately on incremental search
When typing in the "Search" field, select the current search result (so that it gets highlighted in orange). This makes it easier to understand what will happen if you then type Ctrl-S. Signed-off-by: Stefan Haller <stefan@haller-berlin.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent c461499 commit 30441a6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

gitk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8053,9 +8053,12 @@ proc incrsearch {name ix op} {
80538053
}
80548054
}
80558055
if {$searchstring ne {}} {
8056-
set here [$ctext search $searchdirn -- $searchstring anchor]
8056+
set here [$ctext search -count mlen $searchdirn -- $searchstring anchor]
80578057
if {$here ne {}} {
80588058
$ctext see $here
8059+
set mend "$here + $mlen c"
8060+
$ctext tag remove sel 1.0 end
8061+
$ctext tag add sel $here $mend
80598062
suppress_highlighting_file_for_current_scrollpos
80608063
highlightfile_for_scrollpos $here
80618064
}

0 commit comments

Comments
 (0)