From 44211e9099d0800fb5d35f2367247f0085abcbb7 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 25 Apr 2024 16:49:09 +0200 Subject: support new viewport table for vis >= v0.9 --- spellcheck.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spellcheck.lua b/spellcheck.lua index 0c3549d..d09f1e9 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -167,7 +167,8 @@ vis.events.subscribe(vis.events.WIN_HIGHLIGHT, function(win) not win:style_define(spellcheck.typo_style_id, spellcheck.typo_style) then return end - local viewport = win.viewport + -- Be backward compatible with vis < v0.9 + local viewport = win.viewport.bytes or win.viewport local viewport_text = win.file:content(viewport) local typos -- cgit v1.2.3