1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +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

@ -49,7 +49,7 @@ func (self *SnakeController) GetKeybindings(opts types.KeybindingsOpts) []*types
}
func (self *SnakeController) Context() types.Context {
return self.contexts.Snake
return self.c.Contexts().Snake
}
func (self *SnakeController) GetOnFocus() func(types.OnFocusOpts) error {
@ -62,7 +62,7 @@ func (self *SnakeController) GetOnFocus() func(types.OnFocusOpts) error {
func (self *SnakeController) GetOnFocusLost() func(types.OnFocusLostOpts) error {
return func(types.OnFocusLostOpts) error {
self.helpers.Snake.ExitGame()
self.helpers.Window.MoveToTopOfWindow(self.contexts.Submodules)
self.helpers.Window.MoveToTopOfWindow(self.c.Contexts().Submodules)
return nil
}
}
@ -75,5 +75,5 @@ func (self *SnakeController) SetDirection(direction snake.Direction) func() erro
}
func (self *SnakeController) Escape() error {
return self.c.PushContext(self.contexts.Submodules)
return self.c.PushContext(self.c.Contexts().Submodules)
}