Fix problem checking utf-8 cont at end of string

This commit is contained in:
Francesco Abbate 2021-10-23 15:03:09 +02:00
parent ffb66cefd7
commit 5cdd800910
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ function tokenizer.tokenize(incoming_syntax, text, state)
repeat
local next = res[2] + 1
-- go to the start of the next utf-8 character
while common.is_utf8_cont(text, next) do
while text:byte(next) and common.is_utf8_cont(text, next) do
next = next + 1
end
res = p.pattern and { text:find(at_start and "^" .. code or code, next) }