summaryrefslogtreecommitdiff
path: root/lib/browser.tcl
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-10 01:19:13 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-10 01:19:13 (GMT)
commit0a84b3d94ff8c29a5d3b738d4f08d1344305b619 (patch)
tree60723fb7c6a4e0d79ebc74ba923eae592393de71 /lib/browser.tcl
parent7eafa2f1578e605e1e68d8ccba9d600cc6b89173 (diff)
parente87fb0f1b4a4b458394a65d664145a9a8001e821 (diff)
downloadgit-0a84b3d94ff8c29a5d3b738d4f08d1344305b619.zip
git-0a84b3d94ff8c29a5d3b738d4f08d1344305b619.tar.gz
git-0a84b3d94ff8c29a5d3b738d4f08d1344305b619.tar.bz2
Merge branch 'maint'
* maint: git-gui: Don't linewrap within console windows git-gui: Correct ls-tree buffering problem in browser
Diffstat (limited to 'lib/browser.tcl')
-rw-r--r--lib/browser.tcl22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/browser.tcl b/lib/browser.tcl
index 4d33052..911e5af 100644
--- a/lib/browser.tcl
+++ b/lib/browser.tcl
@@ -11,6 +11,8 @@ field browser_status {Starting...}
field browser_stack {}
field browser_busy 1
+field ls_buf {}; # Buffered record output from ls-tree
+
constructor new {commit} {
global cursor_ptr M1B
make_toplevel top w
@@ -160,7 +162,7 @@ method _click {was_double_click pos} {
}
method _ls {tree_id {name {}}} {
- set browser_buffer {}
+ set ls_buf {}
set browser_files {}
set browser_busy 1
@@ -184,17 +186,19 @@ method _ls {tree_id {name {}}} {
}
method _read {fd} {
- append browser_buffer [read $fd]
- set pck [split $browser_buffer "\0"]
- set browser_buffer [lindex $pck end]
+ append ls_buf [read $fd]
+ set pck [split $ls_buf "\0"]
+ set ls_buf [lindex $pck end]
set n [llength $browser_files]
$w conf -state normal
foreach p [lrange $pck 0 end-1] {
- set info [split $p "\t"]
- set path [lindex $info 1]
- set info [split [lindex $info 0] { }]
- set type [lindex $info 1]
+ set tab [string first "\t" $p]
+ if {$tab == -1} continue
+
+ 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]
switch -- $type {
@@ -224,7 +228,7 @@ method _read {fd} {
close $fd
set browser_status Ready.
set browser_busy 0
- unset browser_buffer
+ set ls_buf {}
if {$n > 0} {
$w tag add in_sel 1.0 2.0
focus -force $w