From d2136df5384ad320c71156c0aba52a84dd704c03 Mon Sep 17 00:00:00 2001 From: Joe Lim <50560759+joelim-work@users.noreply.github.com> Date: Sun, 10 Mar 2024 13:08:38 +1100 Subject: [PATCH] Clear cached sixels after horizontal resize (#1629) --- eval.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eval.go b/eval.go index 17e927fe..a406c32b 100644 --- a/eval.go +++ b/eval.go @@ -90,6 +90,9 @@ func (e *setExpr) eval(app *app, args []string) { if app.nav.height != app.ui.wins[0].h { app.nav.height = app.ui.wins[0].h app.nav.regCache = make(map[string]*reg) + if gOpts.sixel { + app.ui.sxScreen.lastFile = "" + } } app.ui.loadFile(app, true) } @@ -336,6 +339,10 @@ func (e *setExpr) eval(app *app, args []string) { } gOpts.ratios = rats app.ui.wins = getWins(app.ui.screen) + if gOpts.sixel { + app.nav.regCache = make(map[string]*reg) + app.ui.sxScreen.lastFile = "" + } app.ui.loadFile(app, true) case "scrolloff": n, err := strconv.Atoi(e.val) @@ -1352,6 +1359,10 @@ func (e *callExpr) eval(app *app, args []string) { app.nav.height = app.ui.wins[0].h app.nav.regCache = make(map[string]*reg) } + if gOpts.sixel { + app.nav.regCache = make(map[string]*reg) + app.ui.sxScreen.lastFile = "" + } for _, dir := range app.nav.dirs { dir.boundPos(app.nav.height) }