aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-04-25 16:49:09 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2024-04-25 16:49:09 +0200
commit44211e9099d0800fb5d35f2367247f0085abcbb7 (patch)
tree165c4ce2ddff70311eb76269ae2f6e83363aa4b7
parent0914016d89e3f12429eed41513c7d5ac37fd39be (diff)
downloadvis-spellcheck-44211e9099d0800fb5d35f2367247f0085abcbb7.tar.gz
vis-spellcheck-44211e9099d0800fb5d35f2367247f0085abcbb7.zip
support new viewport table for vis >= v0.9
-rw-r--r--spellcheck.lua3
1 files changed, 2 insertions, 1 deletions
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