Code

git-gui: Allow double-click in checkout dialog to start checkout
[git.git] / lib / choose_rev.tcl
index 7f2b4e603d59588a8fbada60e14556e764b5de72..afd81707ceb08ccc106e76b082f892c824dfb828 100644 (file)
@@ -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
                        }
@@ -184,6 +185,10 @@ method focus_filter {} {
        }
 }
 
+method bind_listbox {event script}  {
+       bind $w_list $event $script
+}
+
 method get_local_branch {} {
        if {$revtype eq {head}} {
                return [_expr $this]
@@ -312,6 +317,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