When moving backwards or forwards through the history list, this
automatically switches the view so that each point that we jump to
is shown in the same view that it was originally displayed in.
Signed-off-by: Paul Mackerras <paulus@samba.org>
$commitidx $rowlaidout $rowoptim $numcommits \
$linesegends $leftover $commfd]
fileevent $commfd readable {}
$commitidx $rowlaidout $rowoptim $numcommits \
$linesegends $leftover $commfd]
fileevent $commfd readable {}
- } elseif {![info exists viewdata($curview)]} {
+ } elseif {![info exists viewdata($curview)]
+ || [lindex $viewdata($curview) 0] ne {}} {
set viewdata($curview) \
[list {} $displayorder $parentlist $childlist $rowidlist \
$rowoffsets $rowrangelist $commitlisted]
set viewdata($curview) \
[list {} $displayorder $parentlist $childlist $rowidlist \
$rowoffsets $rowrangelist $commitlisted]
allcanvs yview moveto $yf
drawvisible
selectline $row 0
allcanvs yview moveto $yf
drawvisible
selectline $row 0
+ if {$phase eq {}} {
+ global maincursor textcursor
+ . config -cursor $maincursor
+ settextcursor $textcursor
+ } else {
+ . config -cursor watch
+ settextcursor watch
+ }
}
if {[info exists findinprogress]} {
unset findinprogress
}
if {[info exists findinprogress]} {
unset findinprogress
- if {$phase != "incrdraw"} {
. config -cursor $maincursor
settextcursor $textcursor
}
. config -cursor $maincursor
settextcursor $textcursor
}
}
proc addtohistory {cmd} {
}
proc addtohistory {cmd} {
- global history historyindex
+ global history historyindex curview
+ set elt [list $curview $cmd]
- && [lindex $history [expr {$historyindex - 1}]] == $cmd} {
+ && [lindex $history [expr {$historyindex - 1}]] == $elt} {
return
}
if {$historyindex < [llength $history]} {
return
}
if {$historyindex < [llength $history]} {
- set history [lreplace $history $historyindex end $cmd]
+ set history [lreplace $history $historyindex end $elt]
}
incr historyindex
if {$historyindex > 1} {
}
incr historyindex
if {$historyindex > 1} {
.ctop.top.bar.rightbut conf -state disabled
}
.ctop.top.bar.rightbut conf -state disabled
}
+proc godo {elt} {
+ global curview
+
+ set view [lindex $elt 0]
+ set cmd [lindex $elt 1]
+ if {$curview != $view} {
+ showview $view
+ }
+ eval $cmd
+}
+
proc goback {} {
global history historyindex
if {$historyindex > 1} {
incr historyindex -1
proc goback {} {
global history historyindex
if {$historyindex > 1} {
incr historyindex -1
- set cmd [lindex $history [expr {$historyindex - 1}]]
- eval $cmd
+ godo [lindex $history [expr {$historyindex - 1}]]
.ctop.top.bar.rightbut conf -state normal
}
if {$historyindex <= 1} {
.ctop.top.bar.rightbut conf -state normal
}
if {$historyindex <= 1} {
if {$historyindex < [llength $history]} {
set cmd [lindex $history $historyindex]
incr historyindex
if {$historyindex < [llength $history]} {
set cmd [lindex $history $historyindex]
incr historyindex
.ctop.top.bar.leftbut conf -state normal
}
if {$historyindex >= [llength $history]} {
.ctop.top.bar.leftbut conf -state normal
}
if {$historyindex >= [llength $history]} {