Improve RemoveMultiCursor & RemoveAllMultiCursors actions return values

This commit is contained in:
Dmytro Maluka
2024-06-15 17:28:29 +02:00
parent 781f057e6f
commit fc5d83f6c6

View File

@@ -2023,8 +2023,10 @@ func (h *BufPane) RemoveMultiCursor() bool {
h.Buf.RemoveCursor(h.Buf.NumCursors() - 1)
h.Buf.SetCurCursor(h.Buf.NumCursors() - 1)
h.Buf.UpdateCursors()
} else {
} else if h.multiWord {
h.multiWord = false
} else {
return false
}
h.Relocate()
return true
@@ -2032,8 +2034,12 @@ func (h *BufPane) RemoveMultiCursor() bool {
// RemoveAllMultiCursors removes all cursors except the base cursor
func (h *BufPane) RemoveAllMultiCursors() bool {
h.Buf.ClearCursors()
h.multiWord = false
if h.Buf.NumCursors() > 1 || h.multiWord {
h.Buf.ClearCursors()
h.multiWord = false
} else {
return false
}
h.Relocate()
return true
}