From 0d46df394bbc27b4898e718f259f438139e04c44 Mon Sep 17 00:00:00 2001 From: Nomarian Date: Thu, 9 Oct 2025 10:54:27 -0400 Subject: typo_iter only returns start,finish or nil if typo is nil --- spellcheck.lua | 6 +++--- 1 file 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 -- cgit v1.2.3