fix: clean preview if directory is empty (#2369)

* fix: clean preview if directory is empty

* Update `CHANGELOG.md`
This commit is contained in:
Joe Lim authored and GitHub committed 2026-02-07 18:27:24 +11:00
1 parent 18ab3cf650
commit 1ed9e96aa2
2 files changed
+8 -4

No files matched your search

+4 -4
View File
@@ -744,6 +744,10 @@ type reg struct {
}
func (ui *ui) loadFile(app *app, volatile bool) {
if volatile {
app.nav.previewChan <- ""
}
curr := app.nav.currFile()
if curr == nil {
return
@@ -754,10 +758,6 @@ func (ui *ui) loadFile(app *app, volatile bool) {
onSelect(app)
}
if volatile {
app.nav.previewChan <- ""
}
if !gOpts.preview {
return
}