MCPcopy
hub / github.com/peco/peco / wrapClearSequence

Function wrapClearSequence

keymap.go:108–123  ·  view source on GitHub ↗

wrapClearSequence wraps an action to clear the accumulated key sequence after execution.

(a Action)

Source from the content-addressed store, hash-verified

106
107// wrapClearSequence wraps an action to clear the accumulated key sequence after execution.
108func 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
125const maxResolveActionDepth = 100
126

Callers 1

LookupActionMethod · 0.85

Calls 10

KeyEventToStringFunction · 0.92
ActionFuncFuncType · 0.85
InputseqMethod · 0.80
KeyNamesMethod · 0.80
HubMethod · 0.80
AddMethod · 0.65
SendStatusMsgMethod · 0.65
ResetMethod · 0.65
ExecuteMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…