Invalidate cache for recreated files

This commit is contained in:
Joe Lim committed 2024-06-22 17:17:35 +10:00
1 parent adaf464fea
commit c2879498a2
3 files changed
+17 -3

No files matched your search

+4 -1
View File
@@ -45,7 +45,7 @@ func newApp(ui *ui, nav *nav) *app {
nav: nav,
ticker: new(time.Ticker),
quitChan: quitChan,
watch: newWatch(nav.dirChan, nav.fileChan),
watch: newWatch(nav.dirChan, nav.fileChan, nav.delChan),
}
sigChan := make(chan os.Signal, 1)
@@ -457,6 +457,9 @@ func (app *app) loop() {
app.ui.loadFile(app, false)
app.ui.draw(app.nav)
case path := <-app.nav.delChan:
delete(app.nav.dirCache, path)
delete(app.nav.regCache, path)
case ev := <-app.ui.evChan:
e := app.ui.readEvent(ev, app.nav)
if e == nil {