MCPcopy
hub / github.com/micro-editor/micro / ShowKeyCmd

Method ShowKeyCmd

internal/action/command.go:834–850  ·  view source on GitHub ↗

ShowKeyCmd displays the action that a key is bound to

(args []string)

Source from the content-addressed store, hash-verified

832
833// ShowKeyCmd displays the action that a key is bound to
834func (h *BufPane) ShowKeyCmd(args []string) {
835 if len(args) < 1 {
836 InfoBar.Error("Please provide a key to show")
837 return
838 }
839
840 event, err := findEvent(parseKeyArg(args[0]))
841 if err != nil {
842 InfoBar.Error(err)
843 return
844 }
845 if action, ok := config.Bindings["buffer"][event.Name()]; ok {
846 InfoBar.Message(action)
847 } else {
848 InfoBar.Message(args[0], " has no binding")
849 }
850}
851
852// BindCmd creates a new keybinding
853func (h *BufPane) BindCmd(args []string) {

Callers

nothing calls this directly

Calls 5

findEventFunction · 0.85
parseKeyArgFunction · 0.85
NameMethod · 0.65
MessageMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected