sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 42e7aeaa907444acfcd1e1c30681c30ccb0cf2f1
parent 9b50f038502d4d005b02230d69daae322f2e4422
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date:   Thu, 21 Jan 2010 23:46:40 -0800

fix textfield truncation

Long query strings (for example) are (for some people) silently truncated.
Other people have seen large amounts of whitespace inserted at word boundaries.
These issues are caused by using a multiline text field. This patch uses a
single-line dynamically growable textfield instead. It also disables the
field-blanking misfeature.

Diffstat:
M lib/sup/textfield.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
@@ -33,7 +33,9 @@ class TextField
     @w, @y, @x, @width = window, y, x, width
     @question = question
     @completion_block = block
-    @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
+    @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 0, 0
+    @field.opts_off Ncurses::Form::O_STATIC
+    @field.opts_off Ncurses::Form::O_BLANK
     @form = Ncurses::Form.new_form [@field]
     @value = default || ''
     Ncurses::Form.post_form @form