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

Method startEdit

internal/tui/auth_tab.go:127–144  ·  view source on GitHub ↗

startEdit activates inline editing for a field on the currently selected auth file.

(fieldIdx int)

Source from the content-addressed store, hash-verified

125
126// startEdit activates inline editing for a field on the currently selected auth file.
127func (m *authTabModel) startEdit(fieldIdx int) tea.Cmd {
128 if m.cursor >= len(m.files) {
129 return nil
130 }
131 f := m.files[m.cursor]
132 m.editFileName = getString(f, "name")
133 m.editField = fieldIdx
134 m.editing = true
135
136 // Pre-populate with current value
137 key := authEditableFields[fieldIdx].key
138 currentVal := getAnyString(f, key)
139 m.editInput.SetValue(currentVal)
140 m.editInput.Focus()
141 m.editInput.Prompt = fmt.Sprintf(" %s: ", authEditableFields[fieldIdx].label)
142 m.viewport.SetContent(m.renderContent())
143 return textinput.Blink
144}
145
146func (m *authTabModel) SetSize(w, h int) {
147 m.width = w

Callers 1

handleNormalInputMethod · 0.95

Calls 3

renderContentMethod · 0.95
getStringFunction · 0.85
getAnyStringFunction · 0.85

Tested by

no test coverage detected