From 1ad6daede22e7bfccb0b4631bc575abf85c98010 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:32:33 +0200 Subject: [PATCH] Text area has default size to avoid issues before first Draw. Fixes #1025 --- textarea.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/textarea.go b/textarea.go index 842fad0..bdee098 100644 --- a/textarea.go +++ b/textarea.go @@ -1,6 +1,7 @@ package tview import ( + "math" "strings" "unicode" "unicode/utf8" @@ -363,6 +364,8 @@ func NewTextArea() *TextArea { lastAction: taActionOther, minCursorPrefix: minCursorPrefixDefault, minCursorSuffix: minCursorSuffixDefault, + lastWidth: math.MaxInt / 2, // We need this so some functions work before the first draw. + lastHeight: 1, } t.editText.Grow(editBufferMinCap) t.spans[0] = textAreaSpan{previous: -1, next: 1}