fix: resolve funcorder and noinlineerr issues

This commit is contained in:
user
2026-02-20 03:30:01 -08:00
parent 2f6d1f284c
commit a9586eb95f
2 changed files with 40 additions and 39 deletions

View File

@@ -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.

View File

@@ -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
}
}