MCPcopy
hub / github.com/peco/peco / wrapRememberSequence

Function wrapRememberSequence

keymap.go:96–105  ·  view source on GitHub ↗

wrapRememberSequence wraps an action to record the key press as part of a multi-key sequence.

(a Action)

Source from the content-addressed store, hash-verified

94
95// wrapRememberSequence wraps an action to record the key press as part of a multi-key sequence.
96func 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.
108func wrapClearSequence(a Action) Action {

Callers 1

LookupActionMethod · 0.85

Calls 8

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…