aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-08-26 16:36:22 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-08-26 16:40:53 +0200
commit63afcec9a2f1d1588cc824f2c22284e9c4d66ad2 (patch)
treea4ea687434f4622f9bbbea4db09c59494bebaafb
parent0d224104468c332b3057c92ff297dfb90d8e35e2 (diff)
downloadvis-spellcheck-63afcec9a2f1d1588cc824f2c22284e9c4d66ad2.tar.gz
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.
-rw-r--r--spellcheck.lua2
1 files changed, 1 insertions, 1 deletions
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