From aa6373b5e6ce3e21064bbf32f972dd87a6dcb7db Mon Sep 17 00:00:00 2001 From: Souji Thenria Date: Tue, 26 Dec 2023 05:48:20 +0100 Subject: [PATCH] fix: confirm search when pressing enter This commit fixes an issue that occurred when confirming an initiated search. Pressing 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 Co-authored-by: Carlos Alexandro Becker --- wishlist.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wishlist.go b/wishlist.go index 5b6ef43..cbfd311 100644 --- a/wishlist.go +++ b/wishlist.go @@ -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. @@ -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()