mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-15 01:34:26 +02:00
Push initial context instead of just putting it in the context array
This makes sure activateContext gets called on it.
This commit is contained in:
committed by
Jesse Duffield
parent
40f6767cfc
commit
b7c61aa883
@ -64,9 +64,9 @@ type ContextManager struct {
|
|||||||
sync.RWMutex
|
sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewContextManager(initialContext types.Context) ContextManager {
|
func NewContextManager() ContextManager {
|
||||||
return ContextManager{
|
return ContextManager{
|
||||||
ContextStack: []types.Context{initialContext},
|
ContextStack: []types.Context{},
|
||||||
RWMutex: sync.RWMutex{},
|
RWMutex: sync.RWMutex{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,11 +299,15 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
|
|||||||
},
|
},
|
||||||
ScreenMode: initialScreenMode,
|
ScreenMode: initialScreenMode,
|
||||||
// TODO: put contexts in the context manager
|
// TODO: put contexts in the context manager
|
||||||
ContextManager: NewContextManager(initialContext),
|
ContextManager: NewContextManager(),
|
||||||
Contexts: contextTree,
|
Contexts: contextTree,
|
||||||
WindowViewNameMap: initialWindowViewNameMap,
|
WindowViewNameMap: initialWindowViewNameMap,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := gui.c.PushContext(initialContext); err != nil {
|
||||||
|
gui.c.Log.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
gui.RepoStateMap[Repo(currentDir)] = gui.State
|
gui.RepoStateMap[Repo(currentDir)] = gui.State
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user