MCPcopy
hub / github.com/SurgeDM/Surge / updatePaste

Method updatePaste

internal/tui/update.go:15–58  ·  view source on GitHub ↗
(msg tea.PasteMsg)

Source from the content-addressed store, hash-verified

13)
14
15func (m RootModel) updatePaste(msg tea.PasteMsg) (tea.Model, tea.Cmd) {
16
17 if m.state == DashboardState && m.searchActive {
18 var cmd tea.Cmd
19 m.searchInput, cmd = m.searchInput.Update(msg)
20 m.searchQuery = m.searchInput.Value()
21 m.UpdateListItems()
22 return m, cmd
23 }
24
25 switch m.state {
26 case InputState, ExtensionConfirmationState:
27 var cmd tea.Cmd
28 m.inputs[m.focusedInput], cmd = m.inputs[m.focusedInput].Update(msg)
29 return m, cmd
30 case URLUpdateState:
31 var cmd tea.Cmd
32 m.urlUpdateInput, cmd = m.urlUpdateInput.Update(msg)
33 return m, cmd
34 case SpeedLimitsState:
35 if m.speedLimitsIsEditing {
36 var cmd tea.Cmd
37 m.SettingsInput, cmd = m.SettingsInput.Update(msg)
38 return m, cmd
39 }
40 return m, nil
41 case SettingsState:
42 if m.SettingsIsEditing {
43 var cmd tea.Cmd
44 m.SettingsInput, cmd = m.SettingsInput.Update(msg)
45 return m, cmd
46 }
47 return m, nil
48 case CategoryManagerState:
49 if m.catMgrEditing {
50 var cmd tea.Cmd
51 m.catMgrInputs[m.catMgrEditField], cmd = m.catMgrInputs[m.catMgrEditField].Update(msg)
52 return m, cmd
53 }
54 return m, nil
55 default:
56 return m, nil
57 }
58}
59
60// Update handles messages and updates the model
61func (m RootModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

Callers 1

UpdateMethod · 0.95

Calls 2

UpdateListItemsMethod · 0.95
UpdateMethod · 0.45

Tested by

no test coverage detected