mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-09 17:20:57 +00:00
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
This commit is contained in:
parent
fcb09556b1
commit
7fe8d73473
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue