git-gui: Paper bag fix quitting crash after commit
[gitweb.git] / lib / choose_rev.tcl
index 7f2b4e603d59588a8fbada60e14556e764b5de72..6c4c3188f0eab7bf81f35c9eabea6cf77f078f63 100644 (file)
@@ -86,7 +86,7 @@ constructor new {path {title {}}} {
        listbox $w_list \
                -font font_diff \
                -width 50 \
-               -height 5 \
+               -height 10 \
                -selectmode browse \
                -exportselection false \
                -xscrollcommand [cb _sb_set $w.list.sbx h] \
@@ -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