handleCustomInputMode manages keyboard interactions when in custom input mode
(msg tea.Msg)
| 562 | |
| 563 | // handleCustomInputMode manages keyboard interactions when in custom input mode |
| 564 | func (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 |
| 588 | func (m *multiSelectModel) handleCustomInputSubmission() (tea.Model, tea.Cmd) { |
no test coverage detected