From: Michael Stapelberg <michael+sup@stapelberg.de>
To: sup-devel@rubyforge.org
Subject: [sup-devel] [PATCH] Overwrite line contents before drawing the new contents (instead of filling up the rest)
Date: Fri, 07 May 2010 20:55:28 +0200 [thread overview]
Message-ID: <1273258431-sup-4976@midna.zekjur.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Hi,
quote from the commit message:
Overwrite line contents before drawing the new contents (instead of filling
up the rest)
This fixes display problems of mails with tab characters in it, like
"foo\n\tbar"
The problem was that \t is one character but will be displayed as multiple
characters, so that the filling started too early and overwrote valid content
of the line (the "bar" is not visible).
Best regards,
Michael
[-- Attachment #2: 0001-Overwrite-line-contents-before-drawing-the-new-conte.patch --]
[-- Type: application/octet-stream, Size: 1220 bytes --]
From 4a9ddd658b6f4c6220358f1b9ce90c8c3527ea52 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Fri, 7 May 2010 20:48:11 +0200
Subject: [PATCH] Overwrite line contents before drawing the new contents (instead of filling up the rest)
This fixes display problems of mails with tab characters in it, like
"foo\n\tbar"
---
lib/sup/buffer.rb | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index f32be67..9f9e929 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -130,15 +130,13 @@ class Buffer
s ||= ""
maxl = @width - x # maximum display width width
stringl = maxl # string "length"
+
+ # fill up the line with blanks to overwrite old screen contents
+ @w.mvaddstr y, x, " " * maxl unless opts[:no_fill]
+
## the next horribleness is thanks to ruby's lack of widechar support
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
- unless l >= maxl
- @w.mvaddstr(y, x + l, " " * (maxl - l))
- end
- end
end
def clear
--
1.7.0
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next reply other threads:[~2010-05-07 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-07 18:55 Michael Stapelberg [this message]
2010-05-14 1:58 ` Rich Lane
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=1273258431-sup-4976@midna.zekjur.net \
--to=michael+sup@stapelberg.de \
--cc=sup-devel@rubyforge.org \
/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