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

@@ -562,3 +562,12 @@ func (b *Buffer) ClearMatches() {
b.SetState(i, nil)
}
}
func (b *Buffer) clearCursors() {
for i := 1; i < len(b.cursors); i++ {
b.cursors[i] = nil
}
b.cursors = b.cursors[:1]
b.UpdateCursors()
b.Cursor.ResetSelection()
}