diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2024-01-29 18:04:50 +0100 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2024-02-16 13:51:15 +0100 |
commit | 9f0b4d0000c52d23a2dfe0092fe2f6f1714e6ea5 (patch) | |
tree | 0fa1e4bff75ae6f5269abc9b9c27440ce0f444dd | |
parent | 649048c3369f03f5f5f1d5fd107c616f676d5caf (diff) |
Don't omit section headers when filtering the keybindings menu
3 files changed, 2 insertions, 7 deletions
diff --git a/pkg/gui/context/menu_context.go b/pkg/gui/context/menu_context.go index 32d6d7610..7f8656fe7 100644 --- a/pkg/gui/context/menu_context.go +++ b/pkg/gui/context/menu_context.go @@ -112,13 +112,6 @@ func (self *MenuViewModel) GetDisplayStrings(_ int, _ int) [][]string { } func (self *MenuViewModel) GetNonModelItems() []*NonModelItem { - // Don't display section headers when we are filtering. The reason is that - // filtering changes the order of the items (they are sorted by best match), - // so all the sections would be messed up. - if self.FilteredListViewModel.IsFiltering() { - return []*NonModelItem{} - } - result := []*NonModelItem{} menuItems := self.FilteredListViewModel.GetItems() var prevSection *types.MenuSection = nil diff --git a/pkg/integration/tests/filter_and_search/filter_menu.go b/pkg/integration/tests/filter_and_search/filter_menu.go index 70c8244f8..59c47fb71 100644 --- a/pkg/integration/tests/filter_and_search/filter_menu.go +++ b/pkg/integration/tests/filter_and_search/filter_menu.go @@ -26,6 +26,7 @@ var FilterMenu = NewIntegrationTest(NewIntegrationTestArgs{ Filter("Ignore"). Lines( // menu has filtered down to the one item that matches the filter + Contains(`--- Local ---`), Contains(`Ignore`).IsSelected(), ). Confirm() diff --git a/pkg/integration/tests/filter_and_search/filter_menu_cancel_filter_with_escape.go b/pkg/integration/tests/filter_and_search/filter_menu_cancel_filter_with_escape.go index 6fb7166ca..daf55fd0d 100644 --- a/pkg/integration/tests/filter_and_search/filter_menu_cancel_filter_with_escape.go +++ b/pkg/integration/tests/filter_and_search/filter_menu_cancel_filter_with_escape.go @@ -20,6 +20,7 @@ var FilterMenuCancelFilterWithEscape = NewIntegrationTest(NewIntegrationTestArgs Filter("Ignore"). Lines( // menu has filtered down to the one item that matches the filter + Contains(`--- Local ---`), Contains(`Ignore`).IsSelected(), ) |