From: Peter Oberndorfer <kumbayo84@arcor.de>
To: git@vger.kernel.org
Cc: Stefan Haller <stefan@haller-berlin.de>,
Paul Mackerras <paulus@samba.org>
Subject: [PATCH] gitk: Do not select file list entries during diff loading
Date: Sat, 27 Oct 2012 00:03:55 +0200 [thread overview]
Message-ID: <508B08CB.5060702@arcor.de> (raw)
In-Reply-To: <1348078647-22516-1-git-send-email-stefan@haller-berlin.de>
Scrolling notification works by callingscrolltext{}
with with 2 values between 0 and 1
for the beginning and the end of the view relative to the total length.
When a long diff with several files is loaded,
the diff view length is updated several times
and causes executions of scrolltext{} even when
the current view never changed.
Every time scrolltext{} is executed,
a entry in the file list is selected and scrolled to.
This makes it impossible for a user to scroll the file list
while a long diff is still loading.
Signed-off-by: Peter Oberndorfer <kumbayo84@arcor.de>
---
Hi,
i used v3 of the Synchronize patch (+ the 2 fixes on top)
for some time now on mingw,
but i found a slight problem for my usage.
While the diff is loaded, the file list on the right side always scrolls up.
When a single revision touches hundreds of files [1] the loading takes
quite long.
During the diff loading i want to scroll down in the file list to the
relevant file i
am interested in. But the file list jumps up all the time.
Please review/test the patch carefully before applying,
since i do not often work with tcl/tk :-)
(Or suggest better ways to solve this problem)
Greetings Peter
[1] I imported history of a historic project. Each release is represented
by a single commit. Thus one commit contains a lot of files/big amount
of changes.
But most times i am interested in only a single file in the middle of
the file list.
gitk-git/gitk | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index b294c9e..621db87 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -8004,7 +8004,7 @@ proc nextfile {} {
proc clear_ctext {{first 1.0}} {
global ctext smarktop smarkbot
- global ctext_file_names ctext_file_lines
+ global ctext_file_names ctext_file_lines ctext_last_scroll_pos
global pendinglinks
set l [lindex [split $first .] 0]
@@ -8020,6 +8020,7 @@ proc clear_ctext {{first 1.0}} {
}
set ctext_file_names {}
set ctext_file_lines {}
+ set ctext_last_scroll_pos -1
}
proc settabs {{firstab {}}} {
@@ -8162,21 +8163,24 @@ proc
suppress_highlighting_file_for_current_scrollpos {} {
}
proc scrolltext {f0 f1} {
- global searchstring cmitmode ctext
+ global searchstring cmitmode ctext ctext_last_scroll_pos
global suppress_highlighting_file_for_this_scrollpos
+ .bleft.bottom.sb set $f0 $f1
+ if {$searchstring ne {}} {
+ searchmarkvisible 0
+ }
+
set topidx [$ctext index @0,0]
+ if {$topidx eq $ctext_last_scroll_pos} return
+ set ctext_last_scroll_pos $topidx
+
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}
-
- .bleft.bottom.sb set $f0 $f1
- if {$searchstring ne {}} {
- searchmarkvisible 0
- }
}
proc setcoords {} {
@@ -11643,6 +11647,7 @@ set autoselect 1
set autosellen 40
set perfile_attrs 0
set want_ttk 1
+set ctext_last_scroll_pos -1
if {[tk windowingsystem] eq "aqua"} {
set extdifftool "opendiff"
--
1.8.0.rc2.251.g3315d86
next prev parent reply other threads:[~2012-10-26 22:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-18 5:57 [PATCH] gitk: Synchronize highlighting in file view when scrolling diff Stefan Haller
2012-09-18 18:23 ` Peter Oberndorfer
2012-09-19 9:57 ` [PATCH v2] " Stefan Haller
2012-09-18 23:46 ` [PATCH] " Paul Mackerras
2012-09-19 14:28 ` Marc Branchaud
2012-09-19 18:17 ` [PATCH v3] " Stefan Haller
2012-09-23 6:58 ` Paul Mackerras
2012-09-24 5:51 ` Stefan Haller
2012-10-26 22:03 ` Peter Oberndorfer [this message]
2012-10-29 8:56 ` [PATCH] gitk: Do not select file list entries during diff loading Stefan Haller
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=508B08CB.5060702@arcor.de \
--to=kumbayo84@arcor.de \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
--cc=stefan@haller-berlin.de \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.