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

Method setPromptText

internal/tui/keys.go:103–107  ·  view source on GitHub ↗

setPromptText overwrites the textarea, parks the cursor at the end, and refreshes the popover. Centralises the SetValue + CursorEnd + refreshSuggest dance shared by Tab completion and the Enter/Esc arg-popover transitions.

(s string)

Source from the content-addressed store, hash-verified

101// refreshes the popover. Centralises the SetValue + CursorEnd + refreshSuggest
102// dance shared by Tab completion and the Enter/Esc arg-popover transitions.
103func (m *Model) setPromptText(s string) {
104 m.ta.SetValue(s)
105 m.ta.CursorEnd()
106 m.refreshSuggest()
107}
108
109// handleCtrlC implements Ctrl+C's three-level precedence: in-flight cancel >
110// popover close > quit arming. Each level fully handles the key, no fallthrough.

Callers 5

abortTurnMethod · 0.95
handleTabMethod · 0.95
handleEscInPopoverMethod · 0.95
handleEnterMethod · 0.95
unqueuePromptMethod · 0.95

Calls 3

refreshSuggestMethod · 0.95
SetValueMethod · 0.80
CursorEndMethod · 0.80

Tested by

no test coverage detected