From 50639015d748fc14c6484472b60ba7ca68798062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6ran=20Karl?= <3951388+JoeKar@users.noreply.github.com> Date: Sat, 30 Nov 2024 15:25:14 +0100 Subject: [PATCH] cursor: Remove selection reduction by one character on `Deselect()` --- internal/action/actions.go | 1 - internal/buffer/cursor.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/action/actions.go b/internal/action/actions.go index c1a96e33..ec77ba5f 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -293,7 +293,6 @@ func (h *BufPane) CursorLeft() bool { func (h *BufPane) CursorRight() bool { if h.Cursor.HasSelection() { h.Cursor.Deselect(false) - h.Cursor.Right() } else { tabstospaces := h.Buf.Settings["tabstospaces"].(bool) tabmovement := h.Buf.Settings["tabmovement"].(bool) diff --git a/internal/buffer/cursor.go b/internal/buffer/cursor.go index d849f836..f6eb91af 100644 --- a/internal/buffer/cursor.go +++ b/internal/buffer/cursor.go @@ -193,7 +193,7 @@ func (c *Cursor) Deselect(start bool) { if start { c.Loc = c.CurSelection[0] } else { - c.Loc = c.CurSelection[1].Move(-1, c.buf) + c.Loc = c.CurSelection[1] } c.ResetSelection() c.StoreVisualX()