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>
Paul Mackerras committed
Dec 2, 2008 at 09:02 UTC
8b39e04f39c287d8c66b24cc4f6c72916831455c
1 file changed
+4
-3
gitk
+4
-3
@@ -4121,7 +4121,7 @@ proc askvhighlight {row id} {
4121
4122
proc hfiles_change {} {
4123
global highlight_files filehighlight fhighlights fh_serial
4124
- global highlight_paths gdttype
4124
+ global highlight_paths
4125
4126
if {[info exists filehighlight]} {
4127
# delete previous highlights
@@ -6286,10 +6286,11 @@ proc findmore {} {
6286
proc findselectline {l} {
6287
global findloc commentend ctext findcurline markingmatches gdttype
6288
6289
- set markingmatches 1
6289
+ set markingmatches [expr {$gdttype eq [mc "containing:"]}]
6290
set findcurline $l
6291
selectline $l 1
6292
- if {$findloc == [mc "All fields"] || $findloc == [mc "Comments"]} {
6292
+ if {$markingmatches &&
6293
+ ($findloc eq [mc "All fields"] || $findloc eq [mc "Comments"])} {
6294
# highlight the matches in the comments
6295
set f [$ctext get 1.0 $commentend]
6296
set matches [findmatches $f]