MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / handleEditingKey

Method handleEditingKey

internal/tui/config_tab.go:150–167  ·  view source on GitHub ↗
(msg tea.KeyMsg)

Source from the content-addressed store, hash-verified

148}
149
150func (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
169func (m configTabModel) toggleBool(idx int) tea.Cmd {
170 return func() tea.Msg {

Callers 1

UpdateMethod · 0.95

Calls 4

submitEditMethod · 0.95
renderContentMethod · 0.95
StringMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected