From 202a99873173b1e78351eeee02c1aae7685863c4 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sun, 25 Apr 2021 16:47:10 +0300 Subject: [PATCH] invalidate reg cache when drawbox option changes cc #602 --- eval.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/eval.go b/eval.go index d06b1f8f..d7153c62 100644 --- a/eval.go +++ b/eval.go @@ -41,15 +41,27 @@ func (e *setExpr) eval(app *app, args []string) { case "drawbox": gOpts.drawbox = true app.ui.renew() - app.nav.height = app.ui.wins[0].h + if app.nav.height != app.ui.wins[0].h { + app.nav.height = app.ui.wins[0].h + app.nav.regCache = make(map[string]*reg) + } + app.ui.loadFile(app.nav, true) case "nodrawbox": gOpts.drawbox = false app.ui.renew() - app.nav.height = app.ui.wins[0].h + if app.nav.height != app.ui.wins[0].h { + app.nav.height = app.ui.wins[0].h + app.nav.regCache = make(map[string]*reg) + } + app.ui.loadFile(app.nav, true) case "drawbox!": gOpts.drawbox = !gOpts.drawbox app.ui.renew() - app.nav.height = app.ui.wins[0].h + if app.nav.height != app.ui.wins[0].h { + app.nav.height = app.ui.wins[0].h + app.nav.regCache = make(map[string]*reg) + } + app.ui.loadFile(app.nav, true) case "globsearch": gOpts.globsearch = true case "noglobsearch":