From 715441b44537c3ace7facfa722a3552c3a630fe4 Mon Sep 17 00:00:00 2001 From: Nomarian Date: Thu, 9 Oct 2025 11:15:28 -0400 Subject: typo_iter gmatch [^\n]+ instead and one less check on getting typos --- spellcheck.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spellcheck.lua b/spellcheck.lua index 0e3a0a6..12e8d7b 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -114,14 +114,14 @@ end -- Which will return the next typo and its start and finish in the text, starting by 1. local function typo_iter(text, typos, ignored) -- luacheck: ignore ignored local index = 1 - local unfiltered_iterator, iter_state = typos:gmatch'%S+' + local unfiltered_iterator, iter_state = typos:gmatch'[^\n]+' return function() local typo repeat typo = unfiltered_iterator(iter_state) if not typo then return end - until typo ~= '' and not ignored[typo] + until not ignored[typo] local start, finish -- special case for typos at the beginning of the text -- cgit v1.2.3