gitk: Fix bug in assigning row numbers to arcs

We weren't setting vtokmod and varcmod in renumbervarc, so after a
call to renumbervarc we sometimes weren't reassigning row numbers to
all the arcs whose row numbers had changed.  This fixes it.

This also collapses layoutmore and showstuff into one procedure and
gets rid of the phase variable.

Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Paul Mackerras
2007-12-06 20:50:31 +11:00
parent 7fcc92bff4
commit 38dfe93916

38
gitk
View File

@ -463,6 +463,16 @@ proc renumbervarc {a v} {
} }
set b [lindex $vupptr($v) $a] set b [lindex $vupptr($v) $a]
if {$b != $ka} { if {$b != $ka} {
set tok [lindex $varctok($v) $ka]
if {[string compare $tok $vtokmod($v)] < 0} {
set vtokmod($v) $tok
set varcmod($v) $ka
}
set tok [lindex $varctok($v) $b]
if {[string compare $tok $vtokmod($v)] < 0} {
set vtokmod($v) $tok
set varcmod($v) $b
}
set c [lindex $vdownptr($v) $b] set c [lindex $vdownptr($v) $b]
if {$c == $a} { if {$c == $a} {
lset vdownptr($v) $b [lindex $vleftptr($v) $a] lset vdownptr($v) $b [lindex $vleftptr($v) $a]
@ -1939,7 +1949,7 @@ proc about {} {
message $w.m -text { message $w.m -text {
Gitk - a commit viewer for git Gitk - a commit viewer for git
Copyright <EFBFBD> 2005-2006 Paul Mackerras Copyright © 2005-2007 Paul Mackerras
Use and redistribute under the terms of the GNU General Public License} \ Use and redistribute under the terms of the GNU General Public License} \
-justify center -aspect 400 -border 2 -bg white -relief groove -justify center -aspect 400 -border 2 -bg white -relief groove
@ -3375,30 +3385,20 @@ proc visiblerows {} {
} }
proc layoutmore {} { proc layoutmore {} {
global commitidx viewcomplete numcommits global commitidx viewcomplete curview
global uparrowlen downarrowlen mingaplen curview
set show $commitidx($curview)
if {$show > $numcommits || $viewcomplete($curview)} {
showstuff $show $viewcomplete($curview)
}
}
proc showstuff {canshow last} {
global numcommits pending_select selectedline curview global numcommits pending_select selectedline curview
global selectfirst global selectfirst lastscrollset commitinterest
global lastscrollset commitinterest
set canshow $commitidx($curview)
if {$canshow <= $numcommits && !$viewcomplete($curview)} return
if {$numcommits == 0} { if {$numcommits == 0} {
global phase
set phase "incrdraw"
allcanvs delete all allcanvs delete all
} }
set r0 $numcommits set r0 $numcommits
set prev $numcommits set prev $numcommits
set numcommits $canshow set numcommits $canshow
set t [clock clicks -milliseconds] set t [clock clicks -milliseconds]
if {$prev < 100 || $last || $t - $lastscrollset > 500} { if {$prev < 100 || $viewcomplete($curview) || $t - $lastscrollset > 500} {
set lastscrollset $t set lastscrollset $t
setcanvscroll setcanvscroll
} }
@ -3426,12 +3426,12 @@ proc showstuff {canshow last} {
} }
proc doshowlocalchanges {} { proc doshowlocalchanges {} {
global curview mainheadid phase global curview mainheadid
if {[commitinview $mainheadid $curview]} { if {[commitinview $mainheadid $curview]} {
dodiffindex dodiffindex
} elseif {$phase ne {}} { } else {
lappend commitinterest($mainheadid) {} lappend commitinterest($mainheadid) {dodiffindex}
} }
} }