From 7fe8d7347345d196c0a62a626bfa103900f7558e Mon Sep 17 00:00:00 2001 From: Yannick A Date: Wed, 9 Aug 2017 17:52:38 +0200 Subject: [PATCH] Fix somes selections issues (#771) * SelectLeft on the last character is now possible * SelectLeft on the last character is now possible * CursorRight on selection places the cursor after the last selected character * SelectRight on the last character do not select the last character and do nothing --- cmd/micro/actions.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/micro/actions.go b/cmd/micro/actions.go index 89e2a819..0042b00a 100644 --- a/cmd/micro/actions.go +++ b/cmd/micro/actions.go @@ -249,7 +249,7 @@ func (v *View) CursorRight(usePlugin bool) bool { } if v.Cursor.HasSelection() { - v.Cursor.Loc = v.Cursor.CurSelection[1].Move(-1, v.Buf) + v.Cursor.Loc = v.Cursor.CurSelection[1] v.Cursor.ResetSelection() v.Cursor.StoreVisualX() } else { @@ -347,7 +347,7 @@ func (v *View) SelectLeft(usePlugin bool) bool { } loc := v.Cursor.Loc - count := v.Buf.End().Move(-1, v.Buf) + count := v.Buf.End() if loc.GreaterThan(count) { loc = count } @@ -370,7 +370,7 @@ func (v *View) SelectRight(usePlugin bool) bool { } loc := v.Cursor.Loc - count := v.Buf.End().Move(-1, v.Buf) + count := v.Buf.End() if loc.GreaterThan(count) { loc = count }