Remove dircache option (#2110)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-08-25 23:06:30 +10:00
1 parent 13da770af6
commit 06955cbacc
7 files changed
+33 -68

No files matched your search

+24 -32
View File
@@ -573,42 +573,34 @@ type nav struct {
jumpListInd int
}
func (nav *nav) loadDirInternal(path string) *dir {
d := &dir{
loading: true,
path: path,
sortby: getSortBy(path),
dircounts: getDirCounts(path),
dirfirst: getDirFirst(path),
dironly: getDirOnly(path),
hidden: getHidden(path),
reverse: getReverse(path),
locale: getLocale(path),
visualAnchor: -1,
hiddenfiles: gOpts.hiddenfiles,
ignorecase: gOpts.ignorecase,
ignoredia: gOpts.ignoredia,
}
go func() {
nav.dirChan <- newDir(path)
}()
return d
}
func (nav *nav) loadDir(path string) *dir {
if gOpts.dircache {
d, ok := nav.dirCache[path]
if !ok {
d = nav.loadDirInternal(path)
nav.dirCache[path] = d
return d
d, ok := nav.dirCache[path]
if !ok {
go func() {
nav.dirChan <- newDir(path)
}()
d := &dir{
loading: true,
path: path,
sortby: getSortBy(path),
dircounts: getDirCounts(path),
dirfirst: getDirFirst(path),
dironly: getDirOnly(path),
hidden: getHidden(path),
reverse: getReverse(path),
locale: getLocale(path),
visualAnchor: -1,
hiddenfiles: gOpts.hiddenfiles,
ignorecase: gOpts.ignorecase,
ignoredia: gOpts.ignoredia,
}
nav.checkDir(d)
nav.dirCache[path] = d
return d
}
return nav.loadDirInternal(path)
nav.checkDir(d)
return d
}
func (nav *nav) checkDir(dir *dir) {