Add the Config view: edit and save the settings, applied without a restart

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 23:31:13 +02:00
co-authored by Claude Sonnet 5.5
parent 0ccd02b3c5
commit a4ec9ad71e
25 changed files with 1168 additions and 54 deletions
+20
View File
@@ -51,9 +51,24 @@ func arrowNavigation(f *tview.Form, cancel func(), hooks *browseHooks) {
}
switch ev.Key() {
case tcell.KeyDown:
if pos == total-1 && hooks != nil && hooks.edge != nil && hooks.edge(true) {
return nil
}
f.SetFocus(min(pos+1, total-1))
case tcell.KeyUp:
if pos == 0 && hooks != nil && hooks.edge != nil && hooks.edge(false) {
return nil
}
f.SetFocus(max(pos-1, 0))
case tcell.KeyTab, tcell.KeyBacktab:
dir := 1
if ev.Key() == tcell.KeyBacktab {
dir = -1
}
if hooks != nil && hooks.tab != nil && hooks.tab(dir) {
return nil
}
return ev
case tcell.KeyLeft, tcell.KeyRight:
step := 1
if ev.Key() == tcell.KeyLeft {
@@ -118,6 +133,11 @@ func bindSearchNow(box *tview.Checkbox, searchable func() bool, blocked func())
type browseHooks struct {
browse func(dd *tview.DropDown, index int) // the highlight moved to entry index
abort func() // the list was closed without selecting
// edge is called when Down is pressed on the last field or Up on the first;
// it returns true if it moved the focus elsewhere.
edge func(down bool) bool
// tab is called for Tab (dir 1) and Shift+Tab (dir -1); true if handled.
tab func(dir int) bool
}
// browser mirrors the highlight of an open dropdown list, which tview does