Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: nicolas.pouillard@gmail.com (Nicolas Pouillard)
Subject: [sup-talk] display_length issue with special-characters on non-UTF8 terminal
Date: Wed, 17 Jun 2009 20:34:08 +0200	[thread overview]
Message-ID: <1245263427-sup-997@ausone.local> (raw)
In-Reply-To: <1245254636-sup-2210@entry>

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


      reply	other threads:[~2009-06-17 18:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 10:00 Tarko Tikan
2009-06-12 19:18 ` William Morgan
2009-06-13 11:13   ` Tarko Tikan
2009-06-15 14:10     ` William Morgan
2009-06-17 16:04     ` William Morgan
2009-06-17 18:34       ` Nicolas Pouillard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245263427-sup-997@ausone.local \
    --to=nicolas.pouillard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox