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

Method catMgrBeginAdd

internal/tui/update_category.go:15–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13)
14
15func (m *RootModel) catMgrBeginAdd() {
16 newCat := config.Category{Name: "New Category"}
17 m.Settings.Categories.Categories = append(m.Settings.Categories.Categories, newCat)
18 m.catMgrCursor = len(m.Settings.Categories.Categories) - 1
19 m.catMgrIsNew = true
20 m.catMgrEditing = true
21 m.catMgrError = ""
22 m.catMgrEditField = 0
23 m.catMgrInputs[0].SetValue(newCat.Name)
24 m.catMgrInputs[1].SetValue(newCat.Description)
25 m.catMgrInputs[2].SetValue(newCat.Pattern)
26 m.catMgrInputs[3].SetValue(newCat.Path)
27 m.updateCategoryInputWidthsForViewport()
28 m.catMgrInputs[0].Focus()
29}
30
31func (m *RootModel) blurAllCatInputs() {
32 for i := range m.catMgrInputs {

Callers 1

updateCategoryManagerMethod · 0.95

Tested by

no test coverage detected