reload modified directories when loading cache

Related #92
This commit is contained in:
Gokcehan 2018-06-07 22:19:55 +03:00
parent 9177ddd406
commit 4846a74320

16
nav.go
View File

@ -214,7 +214,21 @@ func (nav *nav) loadDir(path string) *dir {
return d return d
} }
if d.sortType != gOpts.sortType { s, err := os.Stat(d.path)
if err != nil {
return d
}
switch {
case s.ModTime().After(d.loadTime):
go func() {
d.loadTime = time.Now()
nd := newDir(path)
nd.sort()
nd.find(d.name(), nav.height)
nav.dirChan <- nd
}()
case d.sortType != gOpts.sortType:
go func() { go func() {
d.loading = true d.loading = true
name := d.name() name := d.name()