mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-11 15:12:47 +09:00
Fix execution of {Spawn,Remove}MultiCursor in chained actions
- SpawnMultiCursor and RemoveMultiCursor actions change the set of cursors, so we cannot assume that it stays the same. So refresh the `cursors` list after executing every action in the chain. - If execAction() did not execute an action since it is not a multicursor, it should return true, not false, to not prevent executing next actions in the chain.
This commit is contained in:
@@ -150,10 +150,10 @@ func BufMapEvent(k Event, action string) {
|
||||
actionfns = append(actionfns, afn)
|
||||
}
|
||||
bufAction := func(h *BufPane, te *tcell.EventMouse) bool {
|
||||
cursors := h.Buf.GetCursors()
|
||||
success := true
|
||||
for i, a := range actionfns {
|
||||
innerSuccess := true
|
||||
cursors := h.Buf.GetCursors()
|
||||
for j, c := range cursors {
|
||||
if c == nil {
|
||||
continue
|
||||
@@ -589,6 +589,9 @@ func (h *BufPane) execAction(action BufAction, name string, cursor int, te *tcel
|
||||
|
||||
return success
|
||||
}
|
||||
} else {
|
||||
// do nothing but return true, to not break the chain
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user