Skip to content

Commit d675117

Browse files
committed
Fix activation of initial context
This broke with 40f6767; 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.
1 parent 826128a commit d675117

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

pkg/gui/gui_common.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func (self *guiCommon) IsCurrentContext(c types.Context) bool {
7070
return self.CurrentContext().GetKey() == c.GetKey()
7171
}
7272

73+
func (self *guiCommon) ActivateContext(context types.Context) error {
74+
return self.gui.activateContext(context, types.OnFocusOpts{})
75+
}
76+
7377
func (self *guiCommon) GetAppState() *config.AppState {
7478
return self.gui.Config.GetAppState()
7579
}

pkg/gui/layout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (gui *Gui) onInitialViewsCreationForRepo() error {
182182
}
183183

184184
initialContext := gui.currentSideContext()
185-
if err := gui.c.PushContext(initialContext); err != nil {
185+
if err := gui.c.ActivateContext(initialContext); err != nil {
186186
return err
187187
}
188188

pkg/gui/types/common.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type IGuiCommon interface {
4545
CurrentContext() Context
4646
CurrentStaticContext() Context
4747
IsCurrentContext(Context) bool
48+
ActivateContext(context Context) error
4849
// enters search mode for the current view
4950
OpenSearch()
5051

0 commit comments

Comments
 (0)