diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ba1a2bf..03eaaf2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Fixed - Previews are now cleaned when changing to an empty directory (#2369). +- Previews are now correctly updated on `visual-change` (#2373). - The `dircounts` indicator for errors is changed back to `!` instead of `?` (#2372). ## [r41](https://github.com/gokcehan/lf/releases/tag/r41) diff --git a/eval.go b/eval.go index d25e3b74..f80bbf0a 100644 --- a/eval.go +++ b/eval.go @@ -1665,11 +1665,15 @@ func (e *callExpr) eval(app *app, _ []string) { return } dir := app.nav.currDir() + old := dir.ind beg := max(dir.ind-dir.pos, 0) dir.ind, dir.visualAnchor = dir.visualAnchor, dir.ind dir.pos = dir.ind - beg dir.visualWrap = -dir.visualWrap dir.boundPos(app.nav.height) + if old != dir.ind { + app.ui.loadFile(app, true) + } case "cmd-insert": if len(e.args) == 0 { return