gitk: Fix a couple of bugs
insertrow and removerow were trying to adjust rowidlist, rowisopt and rowfinal even if the row where we're inserting/deleting stuff hasn't been laid out yet, which resulted in Tcl errors. This fixes that. Also we weren't deleting the link$linknum tag in appendwithlinks, which resulted in SHA1 IDs in the body of a commit message sometimes getting shown in blue with underlining when they shouldn't. Signed-off-by: Paul Mackerras <paulus@samba.org>maint
parent
687c8765ec
commit
c73adce219
7
gitk
7
gitk
|
@ -4027,7 +4027,9 @@ proc insertrow {row newcmit} {
|
||||||
incr commitidx($curview)
|
incr commitidx($curview)
|
||||||
set ordertok($curview,$newcmit) $ordertok($curview,$p)
|
set ordertok($curview,$newcmit) $ordertok($curview,$p)
|
||||||
|
|
||||||
|
if {$row < [llength $rowidlist]} {
|
||||||
set idlist [lindex $rowidlist $row]
|
set idlist [lindex $rowidlist $row]
|
||||||
|
if {$idlist ne {}} {
|
||||||
if {[llength $kids] == 1} {
|
if {[llength $kids] == 1} {
|
||||||
set col [lsearch -exact $idlist $p]
|
set col [lsearch -exact $idlist $p]
|
||||||
lset idlist $col $newcmit
|
lset idlist $col $newcmit
|
||||||
|
@ -4035,9 +4037,11 @@ proc insertrow {row newcmit} {
|
||||||
set col [llength $idlist]
|
set col [llength $idlist]
|
||||||
lappend idlist $newcmit
|
lappend idlist $newcmit
|
||||||
}
|
}
|
||||||
|
}
|
||||||
set rowidlist [linsert $rowidlist $row $idlist]
|
set rowidlist [linsert $rowidlist $row $idlist]
|
||||||
set rowisopt [linsert $rowisopt $row 0]
|
set rowisopt [linsert $rowisopt $row 0]
|
||||||
set rowfinal [linsert $rowfinal $row [lindex $rowfinal $row]]
|
set rowfinal [linsert $rowfinal $row [lindex $rowfinal $row]]
|
||||||
|
}
|
||||||
|
|
||||||
incr numcommits
|
incr numcommits
|
||||||
|
|
||||||
|
@ -4077,9 +4081,11 @@ proc removerow {row} {
|
||||||
}
|
}
|
||||||
incr commitidx($curview) -1
|
incr commitidx($curview) -1
|
||||||
|
|
||||||
|
if {$row < [llength $rowidlist]} {
|
||||||
set rowidlist [lreplace $rowidlist $row $row]
|
set rowidlist [lreplace $rowidlist $row $row]
|
||||||
set rowisopt [lreplace $rowisopt $row $row]
|
set rowisopt [lreplace $rowisopt $row $row]
|
||||||
set rowfinal [lreplace $rowfinal $row $row]
|
set rowfinal [lreplace $rowfinal $row $row]
|
||||||
|
}
|
||||||
|
|
||||||
incr numcommits -1
|
incr numcommits -1
|
||||||
|
|
||||||
|
@ -4443,6 +4449,7 @@ proc appendwithlinks {text tags} {
|
||||||
set e [lindex $l 1]
|
set e [lindex $l 1]
|
||||||
set linkid [string range $text $s $e]
|
set linkid [string range $text $s $e]
|
||||||
incr e
|
incr e
|
||||||
|
$ctext tag delete link$linknum
|
||||||
$ctext tag add link$linknum "$start + $s c" "$start + $e c"
|
$ctext tag add link$linknum "$start + $s c" "$start + $e c"
|
||||||
setlink $linkid link$linknum
|
setlink $linkid link$linknum
|
||||||
incr linknum
|
incr linknum
|
||||||
|
|
Loading…
Reference in New Issue