wrapRememberSequence wraps an action to record the key press as part of a multi-key sequence.
(a Action)
| 94 | |
| 95 | // wrapRememberSequence wraps an action to record the key press as part of a multi-key sequence. |
| 96 | func wrapRememberSequence(a Action) Action { |
| 97 | return ActionFunc(func(ctx context.Context, state *Peco, ev Event) { |
| 98 | if s, err := keyseq.KeyEventToString(ev.Key, ev.Ch, ev.Mod); err == nil { |
| 99 | seq := state.Inputseq() |
| 100 | seq.Add(s) |
| 101 | state.Hub().SendStatusMsg(ctx, strings.Join(seq.KeyNames(), " "), 0) |
| 102 | } |
| 103 | a.Execute(ctx, state, ev) |
| 104 | }) |
| 105 | } |
| 106 | |
| 107 | // wrapClearSequence wraps an action to clear the accumulated key sequence after execution. |
| 108 | func wrapClearSequence(a Action) Action { |
no test coverage detected
searching dependent graphs…