git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Stefan Haller <stefan@haller-berlin.de>
To: Paul Mackerras <paulus@samba.org>
Cc: Johannes Sixt <j.sixt@viscovery.net>, git@vger.kernel.org
Subject: [PATCH 2/2] gitk: When searching, only highlight files when in Patch mode
Date: Thu,  4 Oct 2012 22:50:17 +0200	[thread overview]
Message-ID: <1349383817-14457-3-git-send-email-stefan@haller-berlin.de> (raw)
In-Reply-To: <1349383817-14457-1-git-send-email-stefan@haller-berlin.de>

This fixes another regression that was introduced in b967135 ("gitk:
Synchronize highlighting in file view when scrolling diff"): when
searching for a string in tree mode, jumping to the next search hit
would highlight the "Comments" entry in the file list.

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
 gitk | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/gitk b/gitk
index 8935284..0ee5585 100755
--- a/gitk
+++ b/gitk
@@ -7967,8 +7967,9 @@ proc highlightfile {cline} {
 }
 
 proc highlightfile_for_scrollpos {topidx} {
-    global difffilestart
+    global cmitmode difffilestart
 
+    if {$cmitmode eq "tree"} return
     if {![info exists difffilestart]} return
 
     set top [lindex [split $topidx .] 0]
@@ -8192,12 +8193,10 @@ proc scrolltext {f0 f1} {
     global searchstring cmitmode ctext
     global suppress_highlighting_file_for_this_scrollpos
 
-    if {$cmitmode ne "tree"} {
-	set topidx [$ctext index @0,0]
-	if {![info exists suppress_highlighting_file_for_this_scrollpos]
-	    || $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
-	    highlightfile_for_scrollpos $topidx
-	}
+    set topidx [$ctext index @0,0]
+    if {![info exists suppress_highlighting_file_for_this_scrollpos]
+	|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
+	highlightfile_for_scrollpos $topidx
     }
 
     catch {unset suppress_highlighting_file_for_this_scrollpos}
-- 
@@ -7967,8 +7967,9 @@ proc highlightfile {cline} {
 }
 
 proc highlightfile_for_scrollpos {topidx} {
-    global difffilestart
+    global cmitmode difffilestart
 
+    if {$cmitmode eq "tree"} return
     if {![info exists difffilestart]} return
 
     set top [lindex [split $topidx .] 0]
@@ -8192,12 +8193,10 @@ proc scrolltext {f0 f1} {
     global searchstring cmitmode ctext
     global suppress_highlighting_file_for_this_scrollpos
 
-    if {$cmitmode ne "tree"} {
-	set topidx [$ctext index @0,0]
-	if {![info exists suppress_highlighting_file_for_this_scrollpos]
-	    || $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
-	    highlightfile_for_scrollpos $topidx
-	}
+    set topidx [$ctext index @0,0]
+    if {![info exists suppress_highlighting_file_for_this_scrollpos]
+	|| $topidx ne $suppress_highlighting_file_for_this_scrollpos} {
+	highlightfile_for_scrollpos $topidx
     }
 
     catch {unset suppress_highlighting_file_for_this_scrollpos}
-- 
1.8.0.rc0.36.gef0f079

  parent reply	other threads:[~2012-10-04 22:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01  8:40 [BUG] gitk: clicking on a connecting line produces can't read "cflist_top" Johannes Sixt
2012-10-04 20:50 ` Stefan Haller
2012-10-04 20:50   ` [PATCH 1/2] gitk: Fix error message when clicking on a connecting line Stefan Haller
2012-10-04 20:50   ` Stefan Haller [this message]
2012-10-21 22:25   ` [BUG] gitk: clicking on a connecting line produces can't read "cflist_top" 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349383817-14457-3-git-send-email-stefan@haller-berlin.de \
    --to=stefan@haller-berlin.de \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).