wrapClearSequence wraps an action to clear the accumulated key sequence after execution.
(a Action)
| 106 | |
| 107 | // wrapClearSequence wraps an action to clear the accumulated key sequence after execution. |
| 108 | func wrapClearSequence(a Action) Action { |
| 109 | return ActionFunc(func(ctx context.Context, state *Peco, ev Event) { |
| 110 | seq := state.Inputseq() |
| 111 | if s, err := keyseq.KeyEventToString(ev.Key, ev.Ch, ev.Mod); err == nil { |
| 112 | seq.Add(s) |
| 113 | } |
| 114 | |
| 115 | if seq.Len() > 0 { |
| 116 | msg := strings.Join(seq.KeyNames(), " ") |
| 117 | state.Hub().SendStatusMsg(ctx, msg, 500*time.Millisecond) |
| 118 | seq.Reset() |
| 119 | } |
| 120 | |
| 121 | a.Execute(ctx, state, ev) |
| 122 | }) |
| 123 | } |
| 124 | |
| 125 | const maxResolveActionDepth = 100 |
| 126 |
no test coverage detected
searching dependent graphs…