Skip to content

Commit

Permalink
Prevent preview flicker when directories are reloaded (#1697)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelim-work authored Jun 17, 2024
1 parent 8d7b192 commit 73030b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ func (app *app) loop() {
app.nav.dirCache[d.path] = d
}

var oldCurrPath string
if curr, err := app.nav.currFile(); err == nil {
oldCurrPath = curr.path
}

for i := range app.nav.dirs {
if app.nav.dirs[i].path == d.path {
app.nav.dirs[i] = d
Expand All @@ -398,7 +403,7 @@ func (app *app) loop() {

curr, err := app.nav.currFile()
if err == nil {
if d.path == app.nav.currDir().path {
if curr.path != oldCurrPath {
app.ui.loadFile(app, true)
if app.ui.msgIsStat {
app.ui.loadFileInfo(app.nav)
Expand Down

0 comments on commit 73030b5

Please sign in to comment.