1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 11:02:41 +03:00

Merge pull request #2551 from stefanhaller/fix-initial-context-activation

This commit is contained in:
Jesse Duffield
2023-05-01 21:22:43 +10:00
committed by GitHub
3 changed files with 6 additions and 1 deletions

View File

@@ -74,6 +74,10 @@ func (self *guiCommon) IsCurrentContext(c types.Context) bool {
return self.CurrentContext().GetKey() == c.GetKey()
}
func (self *guiCommon) ActivateContext(context types.Context) error {
return self.gui.activateContext(context, types.OnFocusOpts{})
}
func (self *guiCommon) GetAppState() *config.AppState {
return self.gui.Config.GetAppState()
}

View File

@@ -182,7 +182,7 @@ func (gui *Gui) onInitialViewsCreationForRepo() error {
}
initialContext := gui.currentSideContext()
if err := gui.c.PushContext(initialContext); err != nil {
if err := gui.c.ActivateContext(initialContext); err != nil {
return err
}

View File

@@ -49,6 +49,7 @@ type IGuiCommon interface {
CurrentContext() Context
CurrentStaticContext() Context
IsCurrentContext(Context) bool
ActivateContext(context Context) error
// enters search mode for the current view
OpenSearch()