Revert "Reload if any component in current path is renamed (#1982)" (#2004)

This reverts commit 12f235fac9.

cc #2003
This commit is contained in:
Joe Lim authored and GitHub committed 2025-06-07 18:09:12 +10:00
1 parent 0da0d79ede
commit 320322c5cd
1 file changed
+5 -10
+5 -10
View File
@@ -404,19 +404,14 @@ func (app *app) loop() {
oldCurrPath = curr.path
}
if wd, err := os.Getwd(); err == nil && wd != app.nav.currDir().path {
// if any path component in the current path is renamed, then
// the entire set of directories has to be reloaded
app.nav.cd(wd)
} else {
for i := range app.nav.dirs {
if app.nav.dirs[i].path == d.path {
app.nav.dirs[i] = d
}
for i := range app.nav.dirs {
if app.nav.dirs[i].path == d.path {
app.nav.dirs[i] = d
}
app.nav.position()
}
app.nav.position()
curr, err := app.nav.currFile()
if err == nil {
if curr.path != oldCurrPath {