1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

move diffing menu action to controller

This commit is contained in:
Jesse Duffield
2023-03-23 22:32:41 +11:00
parent 7848958326
commit 2da300f2fb
5 changed files with 98 additions and 97 deletions

View File

@ -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{}
@ -188,20 +201,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
Handler: self.handleCopySelectedSideContextItemToClipboard,
Description: self.c.Tr.LcCopyCommitFileNameToClipboard,
},
{
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),