git-gui: Automatically spell check commit messages as the user types
[gitweb.git] / lib / console.tcl
index c0e6fb3cc2fe9cb66e114d4998b2e91d65548980..5597188d803a1c8217011412a39c14fbbeaf0b3a 100644 (file)
@@ -120,7 +120,7 @@ method _read {fd after} {
                        } else {
                                $w_t delete $console_cr end
                                $w_t insert end "\n"
-                               $w_t insert end [string range $buf $c $cr]
+                               $w_t insert end [string range $buf $c [expr {$cr - 1}]]
                                set c $cr
                                incr c
                        }
@@ -202,14 +202,8 @@ method done {ok} {
 }
 
 method _sb_set {sb orient first last} {
-       if {$first == 0 && $last == 1} {
-               if {[winfo exists $sb]} {
-                       destroy $sb
-               }
-               return
-       }
-
        if {![winfo exists $sb]} {
+               if {$first == $last || ($first == 0 && $last == 1)} return
                if {$orient eq {h}} {
                        scrollbar $sb -orient h -command [list $w_t xview]
                        pack $sb -fill x -side bottom -before $w_t
@@ -218,7 +212,7 @@ method _sb_set {sb orient first last} {
                        pack $sb -fill y -side right -before $w_t
                }
        }
-       catch {$sb set $first $last}
+       $sb set $first $last
 }
 
 }