summaryrefslogtreecommitdiffstats
path: root/lib/rexml/formatters
diff options
context:
space:
mode:
authorser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-28 13:24:46 +0000
committerser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-28 13:24:46 +0000
commit597da25ba9813bf7b82bfebc10fd0ed051e0d6f0 (patch)
treeb44cb54a96b07fa6293e11383c8297e9274af37e /lib/rexml/formatters
parentbb7734803c5a4f9f27716f2105cefe7a7439ef36 (diff)
downloadruby-597da25ba9813bf7b82bfebc10fd0ed051e0d6f0.tar.gz
ruby-597da25ba9813bf7b82bfebc10fd0ed051e0d6f0.tar.xz
ruby-597da25ba9813bf7b82bfebc10fd0ed051e0d6f0.zip
Fixes a bug in the pretty printer related to an incomplete refactoring.
Merge code cleanups Fixes another bug related to the formatting code refactoring in 3.1.7 git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@12853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/formatters')
-rw-r--r--lib/rexml/formatters/pretty.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb
index 78eab2740..22b6d857c 100644
--- a/lib/rexml/formatters/pretty.rb
+++ b/lib/rexml/formatters/pretty.rb
@@ -57,8 +57,11 @@ module REXML
if compact
if node.children.inject(true) {|s,c| s & c.kind_of?(Text)}
string = ""
- node.children.each { |child| write( child, string, 0 ) }
- if string.length + @level < @width
+ old_level = @level
+ @level = 0
+ node.children.each { |child| write( child, string ) }
+ @level = old_level
+ if string.length < @width
output << string
skip = true
end