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>
Shawn O. Pearce committed
Jul 8, 2007 at 21:29 UTC
84d3d7b84c600d90486205bf801580009dc523a8
1 file changed
+5
lib/choose_rev.tcl
+5
@@ -133,6 +133,7 @@ constructor new {path {title {}}} {
133
set i 0
134
foreach spec $spec_head {
135
if {[lindex $spec 0] eq $current_branch} {
136
+ $w_list selection clear 0 end
137
$w_list selection set $i
138
break
139
}
@@ -312,6 +313,10 @@ method _rebuild {pat} {
313
$w_list insert end $txt
314
}
315
}
316
+ if {$cur_specs ne {}} {
317
+ $w_list selection clear 0 end
318
+ $w_list selection set 0
319
+ }
320
321
if {[$w_filter cget -state] ne $ste} {
322
$w_list configure -state $ste