MCPcopy Index your code
hub / github.com/codehamr/codehamr / handleEscInPopover

Method handleEscInPopover

internal/tui/keys.go:197–208  ·  view source on GitHub ↗

handleEscInPopover implements Esc inside the popover: arg level steps back to the command menu; command level closes the popover and clears the textarea.

()

Source from the content-addressed store, hash-verified

195// handleEscInPopover implements Esc inside the popover: arg level steps back to
196// the command menu; command level closes the popover and clears the textarea.
197func (m Model) handleEscInPopover() (tea.Model, tea.Cmd) {
198 if m.suggestArgLevel {
199 // Drop the trailing space and any typed arg prefix so refreshSuggest
200 // lands on the command-level list filtered to the command we were in.
201 cmdName, _, _ := strings.Cut(m.ta.Value(), " ")
202 m.setPromptText(cmdName)
203 return m, nil
204 }
205 m.ta.Reset()
206 m.closePopover()
207 return m, nil
208}
209
210// handleEnter implements the four-way Enter dispatch. Alt+Enter inserts a
211// newline; mid-turn Enter queues the prompt (queuePrompt); command-level Enter

Callers 1

handleKeyMethod · 0.95

Calls 4

setPromptTextMethod · 0.95
closePopoverMethod · 0.95
ValueMethod · 0.80
ResetMethod · 0.80

Tested by

no test coverage detected