handleEscInPopover implements Esc inside the popover: arg level steps back to the command menu; command level closes the popover and clears the textarea.
()
| 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. |
| 197 | func (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 |
no test coverage detected