summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3fc4279)
raw | patch | inline | side by side (parent: 3fc4279)
author | Paul Mackerras <paulus@samba.org> | |
Sat, 16 Jun 2007 11:51:08 +0000 (21:51 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Sat, 23 Jun 2007 10:55:34 +0000 (20:55 +1000) |
It used to be that if you clicked on a line while gitk was still drawing
stuff, it would immediately re-select the first line of the display.
This fixes that.
Signed-off-by: Paul Mackerras <paulus@samba.org>
stuff, it would immediately re-select the first line of the display.
This fixes that.
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index a67137443b2c3cf9083c4ae5c07298032388f01c..b3df24d6963a27b021f4ed1e91798350dac06a42 100755 (executable)
--- a/gitk
+++ b/gitk
global pending_select phase
global commitidx rowlaidout rowoptim linesegends
global commfd nextupdate
- global selectedview
+ global selectedview selectfirst
global vparentlist vchildlist vdisporder vcmitlisted
global hlview selectedhlview
} else {
set yscreen [expr {($ybot - $ytop) / 2}]
}
+ } elseif {[info exists pending_select]} {
+ set selid $pending_select
+ unset pending_select
}
unselectline
normalline
.bar.view entryconf Delete* -state [expr {$n == 0? "disabled": "normal"}]
if {![info exists viewdata($n)]} {
- set pending_select $selid
+ if {$selid ne {}} {
+ set pending_select $selid
+ }
getcommits
return
}
set row 0
setcanvscroll
set yf 0
- set row 0
+ set row {}
+ set selectfirst 0
if {$selid ne {} && [info exists commitrow($n,$selid)]} {
set row $commitrow($n,$selid)
# try to get the selected row in the same position on the screen
}
allcanvs yview moveto $yf
drawvisible
- selectline $row 0
+ if {$row ne {}} {
+ selectline $row 0
+ } elseif {$selid ne {}} {
+ set pending_select $selid
+ } else {
+ if {$numcommits > 0} {
+ selectline 0 0
+ } else {
+ set selectfirst 1
+ }
+ }
if {$phase ne {}} {
if {$phase eq "getcommits"} {
show_status "Reading commits..."
global nextcolor
global parentlist childlist children
global colormap rowtextx
- global linesegends
+ global linesegends selectfirst
set numcommits 0
set displayorder {}
catch {unset rowtextx}
catch {unset idrowranges}
set linesegends {}
+ set selectfirst 1
}
proc setcanvscroll {} {
proc showstuff {canshow} {
global numcommits commitrow pending_select selectedline
global linesegends idrowranges idrangedrawn curview
+ global displayorder selectfirst
if {$numcommits == 0} {
global phase
$commitrow($curview,$pending_select) < $numcommits} {
selectline $commitrow($curview,$pending_select) 1
}
- if {![info exists selectedline] && ![info exists pending_select]} {
- selectline 0 1
+ if {$selectfirst} {
+ if {[info exists selectedline] || [info exists pending_select]} {
+ set selectfirst 0
+ } else {
+ selectline 0 1
+ set selectfirst 0
+ }
}
}
global rowlaidout commitidx curview
global pending_select
- set row $rowlaidout
layoutrows $rowlaidout $commitidx($curview) 1
layouttail
optimize_rows $row 0 $commitidx($curview)