mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-15 21:37:09 +09:00
DoKeyEvent: document return value
The return value of DoKeyEvent() has a dual meaning, which makes the code not obvious and confusing. So at least document it.
This commit is contained in:
@@ -540,7 +540,10 @@ func (h *BufPane) Bindings() *KeyTree {
|
||||
}
|
||||
|
||||
// DoKeyEvent executes a key event by finding the action it is bound
|
||||
// to and executing it (possibly multiple times for multiple cursors)
|
||||
// to and executing it (possibly multiple times for multiple cursors).
|
||||
// Returns true if the action was executed OR if there are more keys
|
||||
// remaining to process before executing an action (if this is a key
|
||||
// sequence event). Returns false if no action found.
|
||||
func (h *BufPane) DoKeyEvent(e Event) bool {
|
||||
binds := h.Bindings()
|
||||
action, more := binds.NextEvent(e, nil)
|
||||
|
||||
@@ -124,7 +124,10 @@ func (h *InfoPane) HandleEvent(event tcell.Event) {
|
||||
}
|
||||
}
|
||||
|
||||
// DoKeyEvent executes a key event for the command bar, doing any overridden actions
|
||||
// DoKeyEvent executes a key event for the command bar, doing any overridden actions.
|
||||
// Returns true if the action was executed OR if there are more keys remaining
|
||||
// to process before executing an action (if this is a key sequence event).
|
||||
// Returns false if no action found.
|
||||
func (h *InfoPane) DoKeyEvent(e KeyEvent) bool {
|
||||
action, more := InfoBindings.NextEvent(e, nil)
|
||||
if action != nil && !more {
|
||||
|
||||
Reference in New Issue
Block a user