diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-03-18 10:58:16 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-03-20 20:14:13 +1100 |
commit | b7c61aa883a5eddc2db6147cff9d13341b0936a8 (patch) | |
tree | 150216c5f7cdf5dca5e5f732616d6426ed83054b /pkg/gui/gui.go | |
parent | 40f6767cfc77931e35bc932b3adae943e7e521f0 (diff) |
Push initial context instead of just putting it in the context array
This makes sure activateContext gets called on it.
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 4e15af94e..4cf416389 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -64,9 +64,9 @@ type ContextManager struct { sync.RWMutex } -func NewContextManager(initialContext types.Context) ContextManager { +func NewContextManager() ContextManager { return ContextManager{ - ContextStack: []types.Context{initialContext}, + ContextStack: []types.Context{}, RWMutex: sync.RWMutex{}, } } @@ -299,11 +299,15 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) { }, ScreenMode: initialScreenMode, // TODO: put contexts in the context manager - ContextManager: NewContextManager(initialContext), + ContextManager: NewContextManager(), Contexts: contextTree, WindowViewNameMap: initialWindowViewNameMap, } + if err := gui.c.PushContext(initialContext); err != nil { + gui.c.Log.Error(err) + } + gui.RepoStateMap[Repo(currentDir)] = gui.State } |