From: Stefan Haller <stefan@haller-berlin.de>
To: Paul Mackerras <paulus@samba.org>
Cc: git@vger.kernel.org
Subject: [PATCH 2/2] gitk: Highlight first search result immediately on incremental search
Date: Sat, 22 Sep 2012 09:40:25 +0200 [thread overview]
Message-ID: <1348299625-90207-3-git-send-email-stefan@haller-berlin.de> (raw)
In-Reply-To: <1348299625-90207-1-git-send-email-stefan@haller-berlin.de>
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>
---
gitk | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gitk b/gitk
index e2c0f1c..39c40de 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
}
--
1.7.12.1.399.gae20e0d
next prev parent reply other threads:[~2012-09-22 7:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-22 7:40 [PATCH 0/2] gitk: Better highlighting of search results Stefan Haller
2012-09-22 7:40 ` [PATCH 1/2] gitk: Highlight current search hit in orange Stefan Haller
2012-09-22 7:40 ` Stefan Haller [this message]
2012-09-23 6:59 ` [PATCH 0/2] gitk: Better highlighting of search results Paul Mackerras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348299625-90207-3-git-send-email-stefan@haller-berlin.de \
--to=stefan@haller-berlin.de \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).