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

standardise controller helper methods

This commit is contained in:
Jesse Duffield
2023-03-23 13:04:57 +11:00
parent fc91ef6a59
commit 711674f6cd
34 changed files with 262 additions and 297 deletions

View File

@ -38,8 +38,8 @@ func (self *ConfirmationController) GetKeybindings(opts types.KeybindingsOpts) [
{
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: func() error {
if len(self.contexts.Suggestions.State.Suggestions) > 0 {
return self.c.ReplaceContext(self.contexts.Suggestions)
if len(self.c.Contexts().Suggestions.State.Suggestions) > 0 {
return self.c.ReplaceContext(self.c.Contexts().Suggestions)
}
return nil
},
@ -61,5 +61,5 @@ func (self *ConfirmationController) Context() types.Context {
}
func (self *ConfirmationController) context() *context.ConfirmationContext {
return self.contexts.Confirmation
return self.c.Contexts().Confirmation
}