fix: restrict preloading files (#2648)

* fix: restric preloading files

* improve patch
This commit is contained in:
valoq authored and GitHub committed 2026-07-31 17:06:12 +10:00
1 parent fb668f12be
commit 9a3b84e672
2 files changed
+5 -13

No files matched your search

+5 -2
View File
@@ -1028,9 +1028,12 @@ func (ui *ui) drawPreview(nav *nav, context *dirContext) {
if gOpts.preview {
if curr.isPreviewable() {
if reg, ok := nav.regCache[curr.path]; ok {
win.printReg(ui.screen, reg, &ui.sxScreen, nav.previewTimer)
reg, ok := nav.regCache[curr.path]
if !ok {
// the shown file can lose its cache entry, e.g. a save that deletes and recreates it
reg = nav.loadReg(curr.path, false)
}
win.printReg(ui.screen, reg, &ui.sxScreen, nav.previewTimer)
} else if curr.IsDir() {
ui.sxScreen.lastFile = ""
dir := nav.getDir(curr.path)