Commit 8b39e04f authored by Paul Mackerras's avatar Paul Mackerras

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 <[email protected]>, but the
implementation is different to his patch, which tested $gdttype at
each place where $markingmatches was tested.
Signed-off-by: default avatarPaul Mackerras <[email protected]>
parent e1160138
...@@ -4121,7 +4121,7 @@ proc askvhighlight {row id} { ...@@ -4121,7 +4121,7 @@ proc askvhighlight {row id} {
proc hfiles_change {} { proc hfiles_change {} {
global highlight_files filehighlight fhighlights fh_serial global highlight_files filehighlight fhighlights fh_serial
global highlight_paths gdttype global highlight_paths
if {[info exists filehighlight]} { if {[info exists filehighlight]} {
# delete previous highlights # delete previous highlights
...@@ -6286,10 +6286,11 @@ proc findmore {} { ...@@ -6286,10 +6286,11 @@ proc findmore {} {
proc findselectline {l} { proc findselectline {l} {
global findloc commentend ctext findcurline markingmatches gdttype global findloc commentend ctext findcurline markingmatches gdttype
set markingmatches 1 set markingmatches [expr {$gdttype eq [mc "containing:"]}]
set findcurline $l set findcurline $l
selectline $l 1 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 # highlight the matches in the comments
set f [$ctext get 1.0 $commentend] set f [$ctext get 1.0 $commentend]
set matches [findmatches $f] set matches [findmatches $f]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment