1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-29 23:17:32 +02:00

Don't omit section headers when filtering the keybindings menu

This commit is contained in:
Stefan Haller 2024-01-29 18:04:50 +01:00
parent 649048c336
commit 9f0b4d0000
3 changed files with 2 additions and 7 deletions

View File

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

View File

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

View File

@ -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(),
)