(msg tea.KeyMsg)
| 148 | } |
| 149 | |
| 150 | func (m configTabModel) handleEditingKey(msg tea.KeyMsg) (configTabModel, tea.Cmd) { |
| 151 | switch msg.String() { |
| 152 | case "enter": |
| 153 | m.editing = false |
| 154 | m.textInput.Blur() |
| 155 | return m, m.submitEdit(m.cursor, m.textInput.Value()) |
| 156 | case "esc": |
| 157 | m.editing = false |
| 158 | m.textInput.Blur() |
| 159 | m.viewport.SetContent(m.renderContent()) |
| 160 | return m, nil |
| 161 | default: |
| 162 | var cmd tea.Cmd |
| 163 | m.textInput, cmd = m.textInput.Update(msg) |
| 164 | m.viewport.SetContent(m.renderContent()) |
| 165 | return m, cmd |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | func (m configTabModel) toggleBool(idx int) tea.Cmd { |
| 170 | return func() tea.Msg { |
no test coverage detected