Delete stale dircache entry during rename (#1138)
* Delete stale dircache entry during rename * Clear `regCache` as well * Add comment
This commit is contained in:
1 parent
382534c4ba
commit
bcd058ace2
1 file changed
+6
@@ -1434,6 +1434,12 @@ func (nav *nav) rename() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It is possible for newPath to already have cache entries if it previously
|
||||||
|
// existed and was deleted. In this case the cache entries should be deleted
|
||||||
|
// before loading newPath to prevent displaying a stale preview. However,
|
||||||
|
// this clears only the current instance of lf, and not any other instances.
|
||||||
|
delete(nav.regCache, newPath)
|
||||||
|
delete(nav.dirCache, newPath)
|
||||||
dir := nav.loadDir(filepath.Dir(newPath))
|
dir := nav.loadDir(filepath.Dir(newPath))
|
||||||
|
|
||||||
if dir.loading {
|
if dir.loading {
|
||||||
|
|||||||
Reference in new issue
Block a user