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:
Zachary Yedidia
2017-09-04 15:47:24 -04:00
parent 4fcdde4149
commit efff850e54
3 changed files with 32 additions and 10 deletions

View File

@@ -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 {