1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-25 22:32:13 +02:00

add mutex to views array

This commit is contained in:
Jesse Duffield
2020-10-01 06:54:29 +10:00
parent ca105692cf
commit c12752cf53
5 changed files with 44 additions and 7 deletions

View File

@@ -617,6 +617,9 @@ func (gui *Gui) getFocusLayout() func(g *gocui.Gui) error {
}
func (gui *Gui) onViewFocusChange() error {
gui.g.Mutexes.ViewsMutex.Lock()
defer gui.g.Mutexes.ViewsMutex.Unlock()
currentView := gui.g.CurrentView()
for _, view := range gui.g.Views() {
view.Highlight = view.Name() != "main" && view == currentView