1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

add mutexes for when looping through views

This commit is contained in:
Jesse Duffield
2020-10-01 07:03:03 +10:00
parent 71d4c552af
commit 5d128adee1

View File

@ -337,6 +337,7 @@ func (gui *Gui) onInitialViewsCreation() error {
gui.setInitialViewContexts()
// add tabs to views
gui.g.Mutexes.ViewsMutex.Lock()
for _, view := range gui.g.Views() {
tabs := gui.viewTabNames(view.Name())
if len(tabs) == 0 {
@ -344,6 +345,7 @@ func (gui *Gui) onInitialViewsCreation() error {
}
view.Tabs = tabs
}
gui.g.Mutexes.ViewsMutex.Unlock()
if err := gui.switchContext(gui.defaultSideContext()); err != nil {
return err