Better fix for reload if current path is renamed (#2005)

This commit is contained in:
Joe Lim authored and GitHub committed 2025-06-07 20:12:31 +10:00
1 parent 320322c5cd
commit 249264b4cd
3 files changed
+26 -6

No files matched your search

+11 -4
View File
@@ -466,13 +466,20 @@ func (app *app) loop() {
}
app.ui.draw(app.nav)
case path := <-app.nav.delChan:
delete(app.nav.dirCache, path)
delete(app.nav.regCache, path)
delete(app.nav.selections, path)
deletePathRecusrive(app.nav.selections, path)
if len(app.nav.selections) == 0 {
app.nav.selectionInd = 0
}
deletePathRecusrive(app.nav.regCache, path)
deletePathRecusrive(app.nav.dirCache, path)
currPath := app.nav.currDir().path
if currPath == path || strings.HasPrefix(currPath, path+string(filepath.Separator)) {
if wd, err := os.Getwd(); err == nil {
app.nav.getDirs(wd)
}
}
case ev := <-app.ui.evChan:
e := app.ui.readEvent(ev, app.nav)
if e == nil {