Merge branch 'maint'
* maint: git-gui: Don't linewrap within console windows git-gui: Correct ls-tree buffering problem in browser
This commit is contained in:
commit
0a84b3d94f
@ -11,6 +11,8 @@ field browser_status {Starting...}
|
|||||||
field browser_stack {}
|
field browser_stack {}
|
||||||
field browser_busy 1
|
field browser_busy 1
|
||||||
|
|
||||||
|
field ls_buf {}; # Buffered record output from ls-tree
|
||||||
|
|
||||||
constructor new {commit} {
|
constructor new {commit} {
|
||||||
global cursor_ptr M1B
|
global cursor_ptr M1B
|
||||||
make_toplevel top w
|
make_toplevel top w
|
||||||
@ -160,7 +162,7 @@ method _click {was_double_click pos} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
method _ls {tree_id {name {}}} {
|
method _ls {tree_id {name {}}} {
|
||||||
set browser_buffer {}
|
set ls_buf {}
|
||||||
set browser_files {}
|
set browser_files {}
|
||||||
set browser_busy 1
|
set browser_busy 1
|
||||||
|
|
||||||
@ -184,17 +186,19 @@ method _ls {tree_id {name {}}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
method _read {fd} {
|
method _read {fd} {
|
||||||
append browser_buffer [read $fd]
|
append ls_buf [read $fd]
|
||||||
set pck [split $browser_buffer "\0"]
|
set pck [split $ls_buf "\0"]
|
||||||
set browser_buffer [lindex $pck end]
|
set ls_buf [lindex $pck end]
|
||||||
|
|
||||||
set n [llength $browser_files]
|
set n [llength $browser_files]
|
||||||
$w conf -state normal
|
$w conf -state normal
|
||||||
foreach p [lrange $pck 0 end-1] {
|
foreach p [lrange $pck 0 end-1] {
|
||||||
set info [split $p "\t"]
|
set tab [string first "\t" $p]
|
||||||
set path [lindex $info 1]
|
if {$tab == -1} continue
|
||||||
set info [split [lindex $info 0] { }]
|
|
||||||
set type [lindex $info 1]
|
set info [split [string range $p 0 [expr {$tab - 1}]] { }]
|
||||||
|
set path [string range $p [expr {$tab + 1}] end]
|
||||||
|
set type [lindex $info 1]
|
||||||
set object [lindex $info 2]
|
set object [lindex $info 2]
|
||||||
|
|
||||||
switch -- $type {
|
switch -- $type {
|
||||||
@ -224,7 +228,7 @@ method _read {fd} {
|
|||||||
close $fd
|
close $fd
|
||||||
set browser_status Ready.
|
set browser_status Ready.
|
||||||
set browser_busy 0
|
set browser_busy 0
|
||||||
unset browser_buffer
|
set ls_buf {}
|
||||||
if {$n > 0} {
|
if {$n > 0} {
|
||||||
$w tag add in_sel 1.0 2.0
|
$w tag add in_sel 1.0 2.0
|
||||||
focus -force $w
|
focus -force $w
|
||||||
|
@ -47,16 +47,20 @@ method _init {} {
|
|||||||
-background white -borderwidth 1 \
|
-background white -borderwidth 1 \
|
||||||
-relief sunken \
|
-relief sunken \
|
||||||
-width 80 -height 10 \
|
-width 80 -height 10 \
|
||||||
|
-wrap none \
|
||||||
-font font_diff \
|
-font font_diff \
|
||||||
-state disabled \
|
-state disabled \
|
||||||
|
-xscrollcommand [list $w.m.sbx set] \
|
||||||
-yscrollcommand [list $w.m.sby set]
|
-yscrollcommand [list $w.m.sby set]
|
||||||
label $w.m.s -text {Working... please wait...} \
|
label $w.m.s -text {Working... please wait...} \
|
||||||
-anchor w \
|
-anchor w \
|
||||||
-justify left \
|
-justify left \
|
||||||
-font font_uibold
|
-font font_uibold
|
||||||
|
scrollbar $w.m.sbx -command [list $w.m.t xview] -orient h
|
||||||
scrollbar $w.m.sby -command [list $w.m.t yview]
|
scrollbar $w.m.sby -command [list $w.m.t yview]
|
||||||
pack $w.m.l1 -side top -fill x
|
pack $w.m.l1 -side top -fill x
|
||||||
pack $w.m.s -side bottom -fill x
|
pack $w.m.s -side bottom -fill x
|
||||||
|
pack $w.m.sbx -side bottom -fill x
|
||||||
pack $w.m.sby -side right -fill y
|
pack $w.m.sby -side right -fill y
|
||||||
pack $w.m.t -side left -fill both -expand 1
|
pack $w.m.t -side left -fill both -expand 1
|
||||||
pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
|
pack $w.m -side top -fill both -expand 1 -padx 5 -pady 10
|
||||||
|
Loading…
Reference in New Issue
Block a user