aboutsummaryrefslogtreecommitdiff
path: root/spellcheck.lua
diff options
context:
space:
mode:
authorNomarian <nomarian@outlook.com>2025-10-09 10:54:27 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-10-12 21:00:37 +0200
commit0d46df394bbc27b4898e718f259f438139e04c44 (patch)
tree6a3a73ec171b7c098ce57f40d758d1429f542bbd /spellcheck.lua
parent426de34f970548f798604ad0b0668105457fe1b0 (diff)
downloadvis-spellcheck-0d46df394bbc27b4898e718f259f438139e04c44.tar.gz
vis-spellcheck-0d46df394bbc27b4898e718f259f438139e04c44.zip
typo_iter only returns start,finish or nil if typo is nil
Diffstat (limited to 'spellcheck.lua')
-rw-r--r--spellcheck.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/spellcheck.lua b/spellcheck.lua
index 009aa12..0e3a0a6 100644
--- a/spellcheck.lua
+++ b/spellcheck.lua
@@ -153,7 +153,7 @@ local function typo_iter(text, typos, ignored) -- luacheck: ignore ignored
end
index = finish
- return typo, start, finish
+ return start, finish
end
end
@@ -179,7 +179,7 @@ vis.events.subscribe(vis.events.WIN_HIGHLIGHT, function(win)
end
end
- for _, start, finish in typo_iter(viewport_text, typos, ignored) do
+ for start, finish in typo_iter(viewport_text, typos, ignored) do
win:style(spellcheck.typo_style_id, viewport.start + start - 1,
viewport.start + finish - 1)
end
@@ -210,7 +210,7 @@ local wrap_lex_func = function(old_lex_func)
end
local i = 1
- for _, typo_start, typo_end in typo_iter(data, typos, ignored) do
+ for typo_start, typo_end in typo_iter(data, typos, ignored) do
repeat
-- no tokens left
if i > #tokens - 1 then