From: benoit.pierre@gmail.com (Benoît PIERRE)
Subject: [sup-talk] [PATCH] fix garbaged text in textfield when using ncursesw
Date: Wed, 19 Aug 2009 22:56:55 +0200 [thread overview]
Message-ID: <1250715278-sup-1941@localdomain> (raw)
Apparently, field_buffer content is not initialized to blanks when using
the wide-character version of ncurses. Forcing a call to
set_field_buffer fix the problem.
---
lib/sup/textfield.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
index b8dec59..76803bf 100644
--- a/lib/sup/textfield.rb
+++ b/lib/sup/textfield.rb
@@ -35,9 +35,9 @@ class TextField
@completion_block = block
@field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
@form = Ncurses::Form.new_form [@field]
- @value = default
+ @value = default || ''
Ncurses::Form.post_form @form
- set_cursed_value default if default
+ set_cursed_value @value
end
def position_cursor
--
1.6.3.3
--
A: Because it destroys the flow of conversation.
Q: Why is top posting dumb?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090819/95de5c6f/attachment.bin>
next reply other threads:[~2009-08-19 20:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-19 20:56 Benoît PIERRE [this message]
2009-08-22 15:01 ` William Morgan
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=1250715278-sup-1941@localdomain \
--to=benoit.pierre@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