mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 14:47:16 +09:00
Clear cursors before performing undo or redo
This fix isn't ideal because it removes the cursors but it does work Fixes #798
This commit is contained in:
@@ -996,6 +996,10 @@ func (v *View) Undo(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if v.Buf.curCursor == 0 {
|
||||
v.Buf.clearCursors()
|
||||
}
|
||||
|
||||
v.Buf.Undo()
|
||||
messenger.Message("Undid action")
|
||||
|
||||
@@ -1011,6 +1015,10 @@ func (v *View) Redo(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if v.Buf.curCursor == 0 {
|
||||
v.Buf.clearCursors()
|
||||
}
|
||||
|
||||
v.Buf.Redo()
|
||||
messenger.Message("Redid action")
|
||||
|
||||
@@ -2028,12 +2036,7 @@ func (v *View) RemoveAllMultiCursors(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
for i := 1; i < len(v.Buf.cursors); i++ {
|
||||
v.Buf.cursors[i] = nil
|
||||
}
|
||||
v.Buf.cursors = v.Buf.cursors[:1]
|
||||
v.Buf.UpdateCursors()
|
||||
v.Cursor.ResetSelection()
|
||||
v.Buf.clearCursors()
|
||||
v.Relocate()
|
||||
|
||||
if usePlugin {
|
||||
|
||||
Reference in New Issue
Block a user