Prevent file showing at bottom during rename

This commit is contained in:
Joe Lim committed 2024-04-13 00:19:38 +10:00
1 parent d3f7c08387
commit c695904614
1 file changed
+7 -3
+7 -3
View File
@@ -1566,9 +1566,13 @@ func (nav *nav) rename() error {
dir := nav.loadDir(filepath.Dir(newPath))
if dir.loading {
file := &file{FileInfo: lstat}
dir.allFiles = append(dir.allFiles, file)
dir.files = append(dir.files, file)
for i := range dir.allFiles {
if dir.allFiles[i].path == oldPath {
dir.allFiles[i] = &file{FileInfo: lstat}
break
}
}
dir.sort()
}
dir.sel(lstat.Name(), nav.height)