summaryrefslogtreecommitdiffstats
path: root/pkg/gui/keybindings.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-23 22:32:41 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commit2da300f2fbcb188783ce9a5384fe1d10c75461f9 (patch)
treeb48aa38a2fbb801d4b195f821bf7aee2ec37ea09 /pkg/gui/keybindings.go
parent7848958326a131d780326ab327bb70fc7df6d622 (diff)
move diffing menu action to controller
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r--pkg/gui/keybindings.go27
1 files changed, 13 insertions, 14 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 11c7f3640..040d634b8 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -29,6 +29,19 @@ func (gui *Gui) outsideFilterMode(f func() error) func() error {
}
}
+func (gui *Gui) validateNotInFilterMode() bool {
+ if gui.State.Modes.Filtering.Active() {
+ _ = gui.c.Confirm(types.ConfirmOpts{
+ Title: gui.c.Tr.MustExitFilterModeTitle,
+ Prompt: gui.c.Tr.MustExitFilterModePrompt,
+ HandleConfirm: gui.helpers.Mode.ExitFilterMode,
+ })
+
+ return false
+ }
+ return true
+}
+
// only to be called from the cheatsheet generate script. This mutates the Gui struct.
func (self *Gui) GetCheatsheetKeybindings() []*types.Binding {
self.g = &gocui.Gui{}
@@ -190,20 +203,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
},
{
ViewName: "",
- Key: opts.GetKey(opts.Config.Universal.DiffingMenu),
- Handler: self.handleCreateDiffingMenuPanel,
- Description: self.c.Tr.LcOpenDiffingMenu,
- OpensMenu: true,
- },
- {
- ViewName: "",
- Key: opts.GetKey(opts.Config.Universal.DiffingMenuAlt),
- Handler: self.handleCreateDiffingMenuPanel,
- Description: self.c.Tr.LcOpenDiffingMenu,
- OpensMenu: true,
- },
- {
- ViewName: "",
Key: opts.GetKey(opts.Config.Universal.ExtrasMenu),
Handler: self.handleCreateExtrasMenuPanel,
Description: self.c.Tr.LcOpenExtrasMenu,