diff options
author | Paul Mackerras <paulus@samba.org> | 2008-03-07 22:51:55 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-03-07 22:51:55 +1100 |
commit | c30acc77fec6b7d793af703c4700f5162db82eb7 (patch) | |
tree | 696efe5401014c1ab8967caa70f24e542eaeef41 /gitk | |
parent | d76afb15ada0e9e29cae2d83cd35d9489a042b0c (diff) | |
download | git-c30acc77fec6b7d793af703c4700f5162db82eb7.tar.gz |
gitk: Fix problem with target row not being in scroll region
Since we limit the rate at which we do updates to the canvas scrolling
regions, it's possible to get into selectline for a row that is
outside the currently-set scrolling region. When this happens,
selectline can't scroll to show the selected line, and as a
consequence, drawvisible chooses some other bogus row to be the
target row.
This fixes it by calling setcanvscroll from selectline in this case.
We also set selectedline (and currentid) before calling drawvisible
so that drawvisible makes the right choice of target row.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-x | gitk | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -5429,7 +5429,7 @@ proc selectline {l isnew} { global commentend idtags linknum global mergemax numcommits pending_select global cmitmode showneartags allcommits - global targetrow targetid + global targetrow targetid lastscrollrows catch {unset pending_select} $canv delete hover @@ -5440,6 +5440,11 @@ proc selectline {l isnew} { set id [commitonrow $l] set targetid $id set targetrow $l + set selectedline $l + set currentid $id + if {$lastscrollrows < $numcommits} { + setcanvscroll + } set y [expr {$canvy0 + $l * $linespc}] set ymax [lindex [$canv cget -scrollregion] 3] @@ -5483,8 +5488,6 @@ proc selectline {l isnew} { addtohistory [list selbyid $id] } - set selectedline $l - set currentid $id $sha1entry delete 0 end $sha1entry insert 0 $id $sha1entry selection from 0 |