Skip to content

Commit

Permalink
Push initial context instead of just putting it in the context array
Browse files Browse the repository at this point in the history
This makes sure activateContext gets called on it.
  • Loading branch information
stefanhaller authored and jesseduffield committed Mar 20, 2023
1 parent 40f6767 commit b7c61aa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
}
}
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit b7c61aa

Please sign in to comment.