From fc5680eecb61ac4d0b4eed3eff33903574a106e1 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Sun, 19 May 2024 10:01:16 +0200 Subject: [PATCH] Fixed text area selection border cases. Fixes #988 --- textarea.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/textarea.go b/textarea.go index e6452e3..842fad0 100644 --- a/textarea.go +++ b/textarea.go @@ -702,7 +702,8 @@ RowLoop: for { if pos[0] == next[0] { if start >= index+lineIndex && start < index+lineIndex+next[1]-pos[1] || - end >= index+lineIndex && end < index+lineIndex+next[1]-pos[1] { + end >= index+lineIndex && end < index+lineIndex+next[1]-pos[1] || + next[0] == 1 && (start == t.length || end == t.length) { // Special case for the end of the text. break } index += lineIndex + next[1] - pos[1]