summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorLibravatar Paul Mackerras <paulus@samba.org>2008-12-02 09:02:46 +1100
committerLibravatar Paul Mackerras <paulus@samba.org>2008-12-02 09:27:30 +1100
commit8b39e04f39c287d8c66b24cc4f6c72916831455c (patch)
tree834df6a6792972405b69002f7cc1f1cd6be0b51f /gitk
parentgitk: Fix context menu items for generating diffs when in tree mode (diff)
downloadtgif-8b39e04f39c287d8c66b24cc4f6c72916831455c.tar.xz
gitk: Highlight only when search type is "containing:".
When the search type is "touching paths" or "adding/removing string", it's not very useful to highlight instances of the search string in the commit message, headline or author name, so this disables the highlighting in those cases. This was suggested by Mark Burton <markb@ordern.com>, but the implementation is different to his patch, which tested $gdttype at each place where $markingmatches was tested. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk7
1 files changed, 4 insertions, 3 deletions
diff --git a/gitk b/gitk
index 9bdaafe408..52d8aaef89 100755
--- a/gitk
+++ b/gitk
@@ -4121,7 +4121,7 @@ proc askvhighlight {row id} {
proc hfiles_change {} {
global highlight_files filehighlight fhighlights fh_serial
- global highlight_paths gdttype
+ global highlight_paths
if {[info exists filehighlight]} {
# delete previous highlights
@@ -6286,10 +6286,11 @@ proc findmore {} {
proc findselectline {l} {
global findloc commentend ctext findcurline markingmatches gdttype
- set markingmatches 1
+ set markingmatches [expr {$gdttype eq [mc "containing:"]}]
set findcurline $l
selectline $l 1
- if {$findloc == [mc "All fields"] || $findloc == [mc "Comments"]} {
+ if {$markingmatches &&
+ ($findloc eq [mc "All fields"] || $findloc eq [mc "Comments"])} {
# highlight the matches in the comments
set f [$ctext get 1.0 $commentend]
set matches [findmatches $f]