Skip to content

Commit

Permalink
fix: confirm search when pressing enter
Browse files Browse the repository at this point in the history
This commit fixes an issue that occurred when confirming an initiated search.
Pressing <enter> to confirm the search executed the first listed item.

Also removes the variable for the 'o' keybinding

The extra keybinding for the o variable is no longer needed.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
SoujiThenria and caarlos0 committed Feb 2, 2024
1 parent 04d8e7f commit aa6373b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions wishlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ var (
key.WithKeys("enter", "o"),
key.WithHelp("enter/o", "connect"),
)
keyO = key.NewBinding(
key.WithKeys("o"),
)
)

// NewListing creates a new listing model for the given endpoints and SSH session.
Expand Down Expand Up @@ -130,7 +127,7 @@ func (m *ListModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.quitting = true
}
if key.Matches(msg, enter) {
if key.Matches(msg, keyO) && m.list.SettingFilter() {
if m.list.SettingFilter() {
break
}
selectedItem := m.list.SelectedItem()
Expand Down

0 comments on commit aa6373b

Please sign in to comment.