From 63afcec9a2f1d1588cc824f2c22284e9c4d66ad2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 26 Aug 2020 16:36:22 +0200 Subject: fix a off-by-one errors If the end of a typo equals the end of a token we didn't advance the typo stream entering an infinite loop. --- spellcheck.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spellcheck.lua') diff --git a/spellcheck.lua b/spellcheck.lua index fe7d8a3..f8c4e8e 100644 --- a/spellcheck.lua +++ b/spellcheck.lua @@ -205,7 +205,7 @@ local wrap_lex_func = function(old_lex_func) table.insert(new_tokens, vis.lexers.ERROR) table.insert(new_tokens, typo_end + 1) end - until(not token_end or token_end > typo_end) + until(not token_end or token_end >= typo_end) end -- add tokens left after we handled all typos -- cgit v1.2.3