mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
move quit actions to controller
This commit is contained in:
parent
6388885699
commit
037cd99138
6 changed files with 118 additions and 96 deletions
|
@ -87,6 +87,26 @@ func (self *GlobalController) GetKeybindings(opts types.KeybindingsOpts) []*type
|
|||
Description: self.c.Tr.LcOpenDiffingMenu,
|
||||
OpensMenu: true,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Universal.Quit),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: self.quit,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Universal.QuitAlt1),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: self.quit,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Universal.QuitWithoutChangingDirectory),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: self.quitWithoutChangingDirectory,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Universal.Return),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: self.escape,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,3 +145,15 @@ func (self *GlobalController) createFilteringMenu() error {
|
|||
func (self *GlobalController) createDiffingMenu() error {
|
||||
return (&DiffingMenuAction{c: self.c}).Call()
|
||||
}
|
||||
|
||||
func (self *GlobalController) quit() error {
|
||||
return (&QuitActions{c: self.c}).Quit()
|
||||
}
|
||||
|
||||
func (self *GlobalController) quitWithoutChangingDirectory() error {
|
||||
return (&QuitActions{c: self.c}).QuitWithoutChangingDirectory()
|
||||
}
|
||||
|
||||
func (self *GlobalController) escape() error {
|
||||
return (&QuitActions{c: self.c}).Escape()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue