From d98bf9db0a4d8a16cf2f378bb09dfcc29227d7f0 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 22 Jan 2024 13:43:05 +0100 Subject: [PATCH] fix(textarea): correctly trim incoming paste --- textarea/textarea.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textarea/textarea.go b/textarea/textarea.go index b6b15ee..ce77c4f 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -340,7 +340,7 @@ func (m *Model) insertRunesFromUserInput(runes []rune) { // If there's not enough space to paste the whole thing cut the pasted // runes down so they'll fit. if availSpace < len(runes) { - runes = runes[:len(runes)-availSpace] + runes = runes[:availSpace] } }