diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2008-07-26 20:15:54 +0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-07-31 20:29:44 +1000 |
commit | 835e62aef81b75301129625f5d5df76149862909 (patch) | |
tree | 6a81162748a6ed550c2352399c64ec84cb18c6d7 | |
parent | 567c34e0ed8b9219589a6f1bc102996ac9773776 (diff) | |
download | git-835e62aef81b75301129625f5d5df76149862909.tar.gz git-835e62aef81b75301129625f5d5df76149862909.tar.xz |
gitk: Fallback to selecting the head commit upon load
Try selecting the head, if the previously selected commit
is not available in the new view.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-x | gitk | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -1506,8 +1506,15 @@ proc chewcommits {} { global numcommits startmsecs if {[info exists pending_select]} { - set row [first_real_row] - selectline $row 1 + update + reset_pending_select {} + + if {[commitinview $pending_select $curview]} { + selectline [rowofcommit $pending_select] 1 + } else { + set row [first_real_row] + selectline $row 1 + } } if {$commitidx($curview) > 0} { #set ms [expr {[clock clicks -milliseconds] - $startmsecs}] @@ -3372,14 +3379,18 @@ proc showview {n} { drawvisible if {$row ne {}} { selectline $row 0 - } elseif {$mainheadid ne {} && [commitinview $mainheadid $curview]} { - selectline [rowofcommit $mainheadid] 1 } elseif {!$viewcomplete($n)} { reset_pending_select $selid } else { - set row [first_real_row] - if {$row < $numcommits} { - selectline $row 0 + reset_pending_select {} + + if {[commitinview $pending_select $curview]} { + selectline [rowofcommit $pending_select] 1 + } else { + set row [first_real_row] + if {$row < $numcommits} { + selectline $row 0 + } } } if {!$viewcomplete($n)} { |