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