sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 814d03eb9ec3f28bee30bc277ba4df44f65daef0
parent 65750a8d4399e7c81742d17fab6c05452606a005
Author: Steve Goldman <sgoldman@tower-research.com>
Date:   Sun, 23 Nov 2008 15:59:49 -0500

use offscreen lines for textfield overflow

In the To:, Cc:, Bcc:, etc., prompts, the TextField was initializing
an NCurses form with zero offscreen lines.  So when the user typed too
many addresses at the prompt the cursor wrapped around and everything
they had typed was clobbered.  This patch initializes the form object
to have 256 offscreen lines (I had no rationale for 256 except that it
is a nice, big power of two).  Now the user can type plenty of names
and the wrap-around works as the user would expect.

Diffstat:
M lib/sup/textfield.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
@@ -33,7 +33,7 @@ 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, 0, 0
+    @field = Ncurses::Form.new_field 1, @width - question.length, @y, @x + question.length, 256, 0
     @form = Ncurses::Form.new_form [@field]
     @value = default
     Ncurses::Form.post_form @form