Skip to content

Commit 1351ba1

Browse files
committed
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>
1 parent 6910ae8 commit 1351ba1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-gui.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3425,7 +3425,12 @@ proc read_blame_incremental {fd w w_cmit w_line w_file} {
34253425
$w_line tag add g$cmit $lno.0 "$lno.0 lineend + 1c"
34263426
$w_file tag add g$cmit $lno.0 "$lno.0 lineend + 1c"
34273427

3428-
if {$blame_data($w,highlight_line) == $lno} {
3428+
if {$blame_data($w,highlight_line) == -1} {
3429+
if {[lindex [$w_file yview] 0] == 0} {
3430+
$w_file see $lno.0
3431+
blame_showcommit $w $w_cmit $w_line $w_file $lno
3432+
}
3433+
} elseif {$blame_data($w,highlight_line) == $lno} {
34293434
blame_showcommit $w $w_cmit $w_line $w_file $lno
34303435
}
34313436

0 commit comments

Comments
 (0)