From: BenoƮt PIERRE Date: Wed, 19 Aug 2009 20:56:55 +0000 (+0200) Subject: fix garbaged text in textfield when using ncursesw X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;ds=sidebyside;h=1a3850da15b12880f355ef70f6bfc881a859874f;p=sup 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. --- diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb index c748c7a..f52aa82 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