nelsam / vidar

vidar is a highly experimental Go editor, written in Go, using gxui
The Unlicense
50 stars 7 forks source link

If project directory contains many files it's not relayout immediately after project was selected in navigator. #169

Closed Kvaz1r closed 5 years ago

Kvaz1r commented 5 years ago

Description

If project directory contains many files it's not relayout immediately after project was selected in navigator.

Steps to reproduce

  1. Select project in the navigator where many files

Expected behavior

Relayout of the navigator.

Actual behavior

Relayout happens only when start execute of another command.

Kvaz1r commented 5 years ago

Funny, while I debugging the issue found a data race. Not sure if it can be reason of the described behaviour though.

Data race between watcher goroutine here and main goroutine here.

Log:

WARNING: DATA RACE Write at 0x00c00037a850 by goroutine 6: github.com/nelsam/vidar/navigator.(ProjectTree).SetRoot() T:/libraries/Gopath/src/github.com/nelsam/vidar/navigator/project_tree.go:119 +0x156 ... Previous read at 0x00c00037a850 by goroutine 34: github.com/nelsam/vidar/navigator.(ProjectTree).watch() T:/libraries/Gopath/src/github.com/nelsam/vidar/navigator/project_tree.go:159 +0x6a ...

nelsam commented 5 years ago

I believe #173 will solve the issue you're talking about as well as the data race.

Kvaz1r commented 5 years ago

Yes, it fixed the issue.