@matheusbsbs / matheus-bagliano / commits / 7a1d9d14c8
Fork 0

gitk: Fix two bugs reported by users

The first was a simple typo where I put $yc instead of [yc $row]. The second was that I broke the logic for keeping up with fast movement through the commits, e.g. when you select a commit and then press down-arrow and let it autorepeat. That got broken when I changed the merge diff display to use git-diff-tree --cc. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Mar 22, 2006 at 10:21 UTC 7a1d9d14c8475715c6b923f378eb72be096c7963
1 file changed +11 -11
gitk
+11 -11
@@ -1267,9 +1267,9 @@ proc drawlineseg {id i} {
1267 set x [xc $row $ccol]
1268 set y [yc $row]
1269 if {$ccol < $col - 1} {
1270 - lappend coords [xc $row [expr {$col - 1}]] $yc
1270 + lappend coords [xc $row [expr {$col - 1}]] [yc $row]
1271 } elseif {$ccol > $col + 1} {
1272 - lappend coords [xc $row [expr {$col + 1}]] $yc
1272 + lappend coords [xc $row [expr {$col + 1}]] [yc $row]
1273 }
1274 lappend coords $x $y
1275 }
@@ -2451,9 +2451,10 @@ proc goforw {} {
2451
2452 proc mergediff {id} {
2453 global parents diffmergeid diffopts mdifffd
2454 - global difffilestart
2454 + global difffilestart diffids
2455
2456 set diffmergeid $id
2457 + set diffids $id
2458 catch {unset difffilestart}
2459 # this doesn't seem to actually affect anything...
2460 set env(GIT_DIFF_OPTS) $diffopts
@@ -2470,7 +2471,7 @@ proc mergediff {id} {
2471
2472 proc getmergediffline {mdf id} {
2473 global diffmergeid ctext cflist nextupdate nparents mergemax
2473 - global difffilestart
2474 + global difffilestart mdifffd
2475
2476 set n [gets $mdf line]
2477 if {$n < 0} {
@@ -2479,7 +2480,8 @@ proc getmergediffline {mdf id} {
2480 }
2481 return
2482 }
2482 - if {![info exists diffmergeid] || $id != $diffmergeid} {
2483 + if {![info exists diffmergeid] || $id != $diffmergeid
2484 + || $mdf != $mdifffd($id)} {
2485 return
2486 }
2487 $ctext conf -state normal
@@ -2589,13 +2591,11 @@ proc gettreediffline {gdtf ids} {
2591 set treediffs($ids) $treediff
2592 unset treepending
2593 if {$ids != $diffids} {
2592 - gettreediffs $diffids
2593 - } else {
2594 - if {[info exists diffmergeid]} {
2595 - contmergediff $ids
2596 - } else {
2597 - addtocflist $ids
2594 + if {![info exists diffmergeid]} {
2595 + gettreediffs $diffids
2596 }
2597 + } else {
2598 + addtocflist $ids
2599 }
2600 return
2601 }