From 00c8a4ae9c986ff7455de3fb88b419f8293befb5 Mon Sep 17 00:00:00 2001 From: William Morgan Date: Sat, 30 May 2009 17:14:34 -0700 Subject: [PATCH] utf8 bugfix: clear lines correctly String#display_length must be used when clearing to the right of lines. --- lib/sup/buffer.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index 6f0acf9..5672e3d 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -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 -- 2.45.2