From 05d01944a18b22a6db63f8432bee7780487bcf7c Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Mon, 13 Nov 2023 07:38:14 +0100 Subject: [PATCH] Don't attempt to find the cursor if the TextArea width is unknown. Fixes #915 --- textarea.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textarea.go b/textarea.go index cf385d8..1cc23b6 100644 --- a/textarea.go +++ b/textarea.go @@ -1443,7 +1443,7 @@ func (t *TextArea) findCursor(clamp bool, startRow int) { t.cursor.column = t.cursor.actualColumn }() - if !clamp && t.cursor.row >= 0 { + if !clamp && t.cursor.row >= 0 || t.lastWidth <= 0 { return // Nothing to do. }