From a9586eb95f571add7a8bafea023a8b86c4966b07 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 20 Feb 2026 03:30:01 -0800 Subject: [PATCH] fix: resolve funcorder and noinlineerr issues --- cmd/chat-cli/ui.go | 76 +++++++++++++++++++++++----------------------- internal/db/db.go | 3 +- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/cmd/chat-cli/ui.go b/cmd/chat-cli/ui.go index 1304460..9d14dc5 100644 --- a/cmd/chat-cli/ui.go +++ b/cmd/chat-cli/ui.go @@ -70,44 +70,6 @@ func NewUI() *UI { return ui } -func (ui *UI) setupInput() { - ui.input = tview.NewInputField(). - SetFieldBackgroundColor(tcell.ColorBlack). - SetFieldTextColor(tcell.ColorWhite) - ui.input.SetDoneFunc(func(key tcell.Key) { - if key != tcell.KeyEnter { - return - } - - text := ui.input.GetText() - if text == "" { - return - } - - ui.input.SetText("") - - if ui.onInput != nil { - ui.onInput(text) - } - }) -} - -func (ui *UI) setupKeyCapture() { - ui.app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { - if event.Modifiers()&tcell.ModAlt != 0 { - r := event.Rune() - if r >= '0' && r <= '9' { - idx := int(r - '0') - ui.SwitchBuffer(idx) - - return nil - } - } - - return event - }) -} - // Run starts the UI event loop (blocks). func (ui *UI) Run() error { return ui.app.Run() @@ -219,6 +181,44 @@ func (ui *UI) BufferIndex(name string) int { return -1 } +func (ui *UI) setupInput() { + ui.input = tview.NewInputField(). + SetFieldBackgroundColor(tcell.ColorBlack). + SetFieldTextColor(tcell.ColorWhite) + ui.input.SetDoneFunc(func(key tcell.Key) { + if key != tcell.KeyEnter { + return + } + + text := ui.input.GetText() + if text == "" { + return + } + + ui.input.SetText("") + + if ui.onInput != nil { + ui.onInput(text) + } + }) +} + +func (ui *UI) setupKeyCapture() { + ui.app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { + if event.Modifiers()&tcell.ModAlt != 0 { + r := event.Rune() + if r >= '0' && r <= '9' { + idx := int(r - '0') + ui.SwitchBuffer(idx) + + return nil + } + } + + return event + }) +} + func (ui *UI) refreshStatus() { // Will be called from the main goroutine via QueueUpdateDraw parent. // Rebuild status from app state — caller must provide context. diff --git a/internal/db/db.go b/internal/db/db.go index e0c2c41..114691e 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -662,7 +662,8 @@ func (s *Database) applyMigrations( migrations []migration, ) error { for _, m := range migrations { - if err := s.applyOneMigration(ctx, m); err != nil { + err := s.applyOneMigration(ctx, m) + if err != nil { return err } }