]> git.cworth.org Git - sup/commitdiff
make text-mode preserve original unmunged text (for saving)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 14 Nov 2007 16:06:23 +0000 (16:06 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 14 Nov 2007 16:06:23 +0000 (16:06 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@701 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/text-mode.rb

index bc5be8c225292b7aa913788c9ddb9070d3ffd967..aa53a845e03b6dae6586107f87920a4e653a1b21 100644 (file)
@@ -7,7 +7,7 @@ class TextMode < ScrollMode
   end
 
   def initialize text=""
-    @text = text.normalize_whitespace
+    @text = text
     update_lines
     buffer.mark_dirty if buffer
     super()
@@ -43,7 +43,7 @@ class TextMode < ScrollMode
 
   def [] i
     return nil unless i < @lines.length
-    @text[@lines[i] ... (i + 1 < @lines.length ? @lines[i + 1] - 1 : @text.length)]
+    @text[@lines[i] ... (i + 1 < @lines.length ? @lines[i + 1] - 1 : @text.length)].normalize_whitespace
 #    (@lines[i] ... (i + 1 < @lines.length ? @lines[i + 1] - 1 : @text.length)).inspect
   end