From: Stefan Haller Date: Sat, 22 Sep 2012 07:40:25 +0000 (+0200) Subject: gitk: Highlight first search result immediately on incremental search X-Git-Tag: v1.8.2-rc0~96^2~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/30441a6f2d5459efa8b64332dfc3a95662a1648a 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 Signed-off-by: Paul Mackerras --- diff --git a/gitk b/gitk index e2c0f1cc65..39c40deb1f 100755 --- a/gitk +++ b/gitk @@ -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 }