From 430aee39be94cfd635e1c0a36010be1a848a59f4 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 9 Feb 2022 12:54:50 +0100 Subject: [PATCH] widget: don't adjust selection in Editor.makeValid Only rune positions are tracked for carets, and they only need adjusting when changing Editor content, not just for re-layout. Signed-off-by: Elias Naur --- widget/editor.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/widget/editor.go b/widget/editor.go index f106a4d9..22a99b26 100644 --- a/widget/editor.go +++ b/widget/editor.go @@ -240,8 +240,6 @@ func (e *Editor) makeValid() { return } e.lines, e.dims = e.layoutText(e.shaper) - e.caret.start = e.closestPosition(combinedPos{runes: e.caret.start}).runes - e.caret.end = e.closestPosition(combinedPos{runes: e.caret.end}).runes e.valid = true }