Skip to content

Commit

Permalink
gitk: Highlight first search result immediately on incremental search
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Haller authored and Paul Mackerras committed Sep 23, 2012
1 parent c461499 commit 30441a6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -8053,9 +8053,12 @@ proc incrsearch {name ix op} {
}
}
if {$searchstring ne {}} {
set here [$ctext search $searchdirn -- $searchstring anchor]
set here [$ctext search -count mlen $searchdirn -- $searchstring anchor]
if {$here ne {}} {
$ctext see $here
set mend "$here + $mlen c"
$ctext tag remove sel 1.0 end
$ctext tag add sel $here $mend
suppress_highlighting_file_for_current_scrollpos
highlightfile_for_scrollpos $here
}
Expand Down

0 comments on commit 30441a6

Please sign in to comment.