mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-05 06:30:28 +09: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:
committed by
Zachary Yedidia
parent
fcb09556b1
commit
7fe8d73473
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user