From mboxrd@z Thu Jan 1 00:00:00 1970 From: nicolas.pouillard@gmail.com (Nicolas Pouillard) Date: Wed, 17 Jun 2009 20:34:08 +0200 Subject: [sup-talk] display_length issue with special-characters on non-UTF8 terminal In-Reply-To: <1245254636-sup-2210@entry> References: <1244536704-sup-7027@valgus> <1244834230-sup-1200@entry> <1244891132-sup-2424@valgus> <1245254636-sup-2210@entry> Message-ID: <1245263427-sup-997@ausone.local> Excerpts from William Morgan's message of Wed Jun 17 18:04:34 +0200 2009: > Reformatted excerpts from Tarko Tikan's message of 2009-06-13: > > william wrote: > > > Does this patch fix the issue? If so, I will release an 0.8.1. > > > > Yes it does. patch :) But I still don't have better idea how to fix > > it so it'll have to stay like this. > > I have released an 0.8.1 which has this patch in it. I still have issues with display_length. I use UTF-8, urxvt and some characters disappear when a line contains special characters. For instance in thread-view-mode if a line contains a special character then the last character is dropped. I've "fixed" the issue by reverting a display_length call to a size call as in the attached patch. diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb index 8eedf96..795b4c9 100644 --- a/lib/sup/buffer.rb +++ b/lib/sup/buffer.rb @@ -114,7 +114,7 @@ class Buffer stringl += 1 while stringl < s.length && s[0 ... stringl].display_length < maxl @w.mvaddstr y, x, s[0 ... stringl] unless opts[:no_fill] - l = s.display_length + l = s.size unless l >= maxl @w.mvaddstr(y, x + l, " " * (maxl - l)) end -- Nicolas Pouillard http://nicolaspouillard.fr