]> git.cworth.org Git - sup/commitdiff
utf8 bugfix: clear lines correctly
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 31 May 2009 00:14:34 +0000 (17:14 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 31 May 2009 00:14:34 +0000 (17:14 -0700)
String#display_length must be used when clearing to the right of lines.

lib/sup/buffer.rb

index 6f0acf9852ea51d4b45125d035476051ed42d2f4..5672e3d6748663ad5f5db4833c799e23eb9fd83f 100644 (file)
@@ -110,8 +110,9 @@ class Buffer
     s ||= ""
     maxl = @width - x
     @w.mvaddstr y, x, s[0 ... maxl]
-    unless s.length >= maxl || opts[:no_fill]
-      @w.mvaddstr(y, x + s.length, " " * (maxl - s.length))
+    l = s.display_length
+    unless l >= maxl || opts[:no_fill]
+      @w.mvaddstr(y, x + l, " " * (maxl - l))
     end
   end