mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-06 23:46:13 +02:00
Fix activation of initial context
This broke with 40f6767cfc77; the symptom is that starting lazygit with a git arg (e.g. "lazygit log") wouldn't activate the requested panel correctly. While it would show in the expanded view, it didn't have a green frame, and keyboard events would go to the files panel.
This commit is contained in:
parent
826128a8e0
commit
d675117289
@ -70,6 +70,10 @@ func (self *guiCommon) IsCurrentContext(c types.Context) bool {
|
|||||||
return self.CurrentContext().GetKey() == c.GetKey()
|
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 {
|
func (self *guiCommon) GetAppState() *config.AppState {
|
||||||
return self.gui.Config.GetAppState()
|
return self.gui.Config.GetAppState()
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ func (gui *Gui) onInitialViewsCreationForRepo() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initialContext := gui.currentSideContext()
|
initialContext := gui.currentSideContext()
|
||||||
if err := gui.c.PushContext(initialContext); err != nil {
|
if err := gui.c.ActivateContext(initialContext); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ type IGuiCommon interface {
|
|||||||
CurrentContext() Context
|
CurrentContext() Context
|
||||||
CurrentStaticContext() Context
|
CurrentStaticContext() Context
|
||||||
IsCurrentContext(Context) bool
|
IsCurrentContext(Context) bool
|
||||||
|
ActivateContext(context Context) error
|
||||||
// enters search mode for the current view
|
// enters search mode for the current view
|
||||||
OpenSearch()
|
OpenSearch()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user