sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 1a3850da15b12880f355ef70f6bfc881a859874f
parent c75e0adcfa6ed3dfa99e8ecc36d8fe6c784aff1e
Author: BenoƮt PIERRE <benoit.pierre@gmail.com>
Date:   Wed, 19 Aug 2009 22:56:55 +0200

fix garbaged text in textfield when using ncursesw

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.

Diffstat:
M lib/sup/textfield.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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