{"thread":{"id":"16359","subject":"[PATCH v2] gitk: Highlight commit/comment text only if search type is \"containing:\".","startedAt":"2008-11-16T22:18:32Z","lastAt":"2008-11-16T22:18:32Z","messageCount":1,"participants":["Mark Burton"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"95981","messageId":"20081116221832.1f4303ee@crow","threadId":"16359","inReplyTo":null,"subject":"[PATCH v2] gitk: Highlight commit/comment text only if search type is \"containing:\".","fromName":"Mark Burton","fromEmail":"markb@ordern.com","sentAt":"2008-11-16T22:18:32Z","receivedAt":"2008-11-16T22:18:32Z","isPatch":true,"sender":{"key":"markb@ordern.com","avatar":null},"body":"\nHighlighting the text in the commit list and comments that matches the\ncurrent find string is useful when the search type is \"containing:\". When\nthe search type is \"touching paths:\" or \"adding/removing string:\" the\nhighlight doesn't help so this patch suppresses the highlighting for\nthose search types.\n\nSigned-off-by: Mark Burton <markb@ordern.com>\n---\n\n Patch same as before - just made the commit message a bit clearer.\n\n gitk-git/gitk |    9 ++++++---\n 1 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 3353f4a..dea8bc8 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -4302,6 +4302,7 @@ proc askfindhighlight {row id} {\n     global nhighlights commitinfo iddrawn\n     global findloc\n     global markingmatches\n+    global gdttype\n \n     if {![info exists commitinfo($id)]} {\n \tgetcommit $id\n@@ -4326,7 +4327,7 @@ proc askfindhighlight {row id} {\n \t\tbolden_name $row mainfontbold\n \t    }\n \t}\n-\tif {$markingmatches} {\n+\tif {$markingmatches && $gdttype eq [mc \"containing:\"]} {\n \t    markrowmatches $row $id\n \t}\n     }\n@@ -5565,6 +5566,7 @@ proc drawcmitrow {row} {\n     global filehighlight fhighlights findpattern nhighlights\n     global hlview vhighlights\n     global highlight_related rhighlights\n+    global gdttype\n \n     if {$row >= $numcommits} return\n \n@@ -5595,7 +5597,7 @@ proc drawcmitrow {row} {\n \tset iddrawn($id) 1\n \tincr nrows_drawn\n     }\n-    if {$markingmatches} {\n+    if {$markingmatches && $gdttype eq [mc \"containing:\"]} {\n \tmarkrowmatches $row $id\n     }\n }\n@@ -6227,7 +6229,8 @@ proc findselectline {l} {\n     set markingmatches 1\n     set findcurline $l\n     selectline $l 1\n-    if {$findloc == [mc \"All fields\"] || $findloc == [mc \"Comments\"]} {\n+    if {$gdttype eq [mc \"containing:\"] &&\n+\t($findloc == [mc \"All fields\"] || $findloc == [mc \"Comments\"])} {\n \t# highlight the matches in the comments\n \tset f [$ctext get 1.0 $commentend]\n \tset matches [findmatches $f]\n-- \n1.6.0.4\n"}]}