summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-02-08 22:41:51 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-02-08 22:41:51 -0500
commit1351ba13e599ef80bbfd9f9ef4ff22117418f030 (patch)
tree1ebc494093c4b20b022a38e992e8f0a7c7eaa92c
parentgit-gui: Redesign the display of annotated files. (diff)
downloadtgif-1351ba13e599ef80bbfd9f9ef4ff22117418f030.tar.xz
git-gui: Jump to the first annotation block as soon as its available.
To help clue users into the fact that annotation data arrives incrementally, and that they should try to locate the region they want while the tool is running, we jump to the first line of the first annotation if the user has not already clicked on a line they are interested in and if the window is still looking at the very top of the file. Since it takes a second (at least on my PowerBook) to even generate the first annotation for git-gui.sh, the user should have plenty of time to adjust the scrollbar or click on a line even before we get that first annotation record in, which allows the user to bypass our automatic jumping. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rwxr-xr-xgit-gui.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 193b46d7f7..53e890af0f 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3425,7 +3425,12 @@ proc read_blame_incremental {fd w w_cmit w_line w_file} {
$w_line tag add g$cmit $lno.0 "$lno.0 lineend + 1c"
$w_file tag add g$cmit $lno.0 "$lno.0 lineend + 1c"
- if {$blame_data($w,highlight_line) == $lno} {
+ if {$blame_data($w,highlight_line) == -1} {
+ if {[lindex [$w_file yview] 0] == 0} {
+ $w_file see $lno.0
+ blame_showcommit $w $w_cmit $w_line $w_file $lno
+ }
+ } elseif {$blame_data($w,highlight_line) == $lno} {
blame_showcommit $w $w_cmit $w_line $w_file $lno
}