From 926061557bc1dd587b83acec6878253eaab933c3 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 9 Aug 2024 14:26:29 +0200 Subject: [PATCH] Make searching available in the filtered commits list It is already possible to search a filtered list by searching first, and then enabling a filter, so I found it inconsistent to not allow searching when you are already filtering. One reason for not allowing this might be that the search status (on the left) hides the filter status (on the right), but if we think that's enough reason to not allow both at the same time, then we should cancel a search when we enter filtering. --- pkg/gui/controllers/local_commits_controller.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/gui/controllers/local_commits_controller.go b/pkg/gui/controllers/local_commits_controller.go index 3900d7f32..2d4232f33 100644 --- a/pkg/gui/controllers/local_commits_controller.go +++ b/pkg/gui/controllers/local_commits_controller.go @@ -207,14 +207,8 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ Description: self.c.Tr.MarkAsBaseCommit, Tooltip: self.c.Tr.MarkAsBaseCommitTooltip, }, - // overriding these navigation keybindings because we might need to load + // overriding this navigation keybinding because we might need to load // more commits on demand - { - Key: opts.GetKey(opts.Config.Universal.StartSearch), - Handler: self.openSearch, - Description: self.c.Tr.StartSearch, - Tag: "navigation", - }, { Key: opts.GetKey(opts.Config.Universal.GotoBottom), Handler: self.gotoBottom, @@ -228,6 +222,14 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ } bindings := append(outsideFilterModeBindings, []*types.Binding{ + // overriding this navigation keybinding because we might need to load + // more commits on demand + { + Key: opts.GetKey(opts.Config.Universal.StartSearch), + Handler: self.openSearch, + Description: self.c.Tr.StartSearch, + Tag: "navigation", + }, { Key: opts.GetKey(opts.Config.Commits.AmendToCommit), Handler: self.withItem(self.amendTo),