MCPcopy Index your code
hub / github.com/coder/coder / handleCustomInputMode

Method handleCustomInputMode

cli/cliui/select.go:564–585  ·  view source on GitHub ↗

handleCustomInputMode manages keyboard interactions when in custom input mode

(msg tea.Msg)

Source from the content-addressed store, hash-verified

562
563// handleCustomInputMode manages keyboard interactions when in custom input mode
564func (m *multiSelectModel) handleCustomInputMode(msg tea.Msg) (tea.Model, tea.Cmd) {
565 keyMsg, ok := msg.(tea.KeyMsg)
566 if !ok {
567 return m, nil
568 }
569
570 switch keyMsg.Type {
571 case tea.KeyEnter:
572 return m.handleCustomInputSubmission()
573
574 case tea.KeyCtrlC:
575 m.canceled = true
576 return m, tea.Quit
577
578 case tea.KeyBackspace:
579 return m.handleCustomInputBackspace()
580
581 default:
582 m.customInput += keyMsg.String()
583 return m, nil
584 }
585}
586
587// handleCustomInputSubmission processes the submission of custom input
588func (m *multiSelectModel) handleCustomInputSubmission() (tea.Model, tea.Cmd) {

Callers 1

UpdateMethod · 0.95

Calls 3

StringMethod · 0.45

Tested by

no test coverage detected