From c6bc8a050bf2df174427bc66a263c4e08f92210f Mon Sep 17 00:00:00 2001 From: tauraamui Date: Thu, 16 Oct 2025 10:01:07 +0100 Subject: [PATCH] fix: use renamed fields for focused element id --- internal/tui/components/dialogs/commands/arguments.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/tui/components/dialogs/commands/arguments.go b/internal/tui/components/dialogs/commands/arguments.go index ca58b1a3212652b3935968249c51768fbc93d269..26ca00b74ec2cd058a5d0f0a75087af577a3b501 100644 --- a/internal/tui/components/dialogs/commands/arguments.go +++ b/internal/tui/components/dialogs/commands/arguments.go @@ -119,7 +119,7 @@ func (c *commandArgumentsDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } case tea.KeyPressMsg: switch { - case key.Matches(msg, c.keys.Cancel): + case key.Matches(msg, c.keys.Close): return c, util.CmdHandler(dialogs.CloseDialogMsg{}) case key.Matches(msg, c.keys.Confirm): if c.focused == len(c.inputs)-1 { @@ -144,9 +144,9 @@ func (c *commandArgumentsDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { c.inputs[c.focused].Focus() case key.Matches(msg, c.keys.Previous): // Move to the previous input - c.inputs[c.focusIndex].Blur() - c.focusIndex = (c.focusIndex - 1 + len(c.inputs)) % len(c.inputs) - c.inputs[c.focusIndex].Focus() + c.inputs[c.focused].Blur() + c.focused = (c.focused - 1 + len(c.inputs)) % len(c.inputs) + c.inputs[c.focused].Focus() case key.Matches(msg, c.keys.Close): return c, util.CmdHandler(dialogs.CloseDialogMsg{}) default: @@ -156,7 +156,7 @@ func (c *commandArgumentsDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } case tea.PasteMsg: var cmd tea.Cmd - c.inputs[c.focusIndex], cmd = c.inputs[c.focusIndex].Update(msg) + c.inputs[c.focused], cmd = c.inputs[c.focused].Update(msg) return c, cmd } return c, nil