summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-09 01:29:54 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-09 02:34:52 (GMT)
commit84d3d7b84c600d90486205bf801580009dc523a8 (patch)
treed20efcf903eb80c30088392c3d818dd1815f84c5 /lib
parent02087abccea681bc0e1f6a9607e97df79ebbf2d9 (diff)
downloadgit-84d3d7b84c600d90486205bf801580009dc523a8.zip
git-84d3d7b84c600d90486205bf801580009dc523a8.tar.gz
git-84d3d7b84c600d90486205bf801580009dc523a8.tar.bz2
git-gui: Default selection to first matching ref
If we have specifications listed in our revision picker mega-widget then we should default the selection within that widget to the first ref available. This way the user does not need to use the spacebar to activate the selection of a ref within the box; instead they can navigate up/down with the arrow keys and be done with it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/choose_rev.tcl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/choose_rev.tcl b/lib/choose_rev.tcl
index 7f2b4e6..1aab56f 100644
--- a/lib/choose_rev.tcl
+++ b/lib/choose_rev.tcl
@@ -133,6 +133,7 @@ constructor new {path {title {}}} {
set i 0
foreach spec $spec_head {
if {[lindex $spec 0] eq $current_branch} {
+ $w_list selection clear 0 end
$w_list selection set $i
break
}
@@ -312,6 +313,10 @@ method _rebuild {pat} {
$w_list insert end $txt
}
}
+ if {$cur_specs ne {}} {
+ $w_list selection clear 0 end
+ $w_list selection set 0
+ }
if {[$w_filter cget -state] ne $ste} {
$w_list configure -state $ste