Return state when tokenizing plaintext syntaxes

This commit is contained in:
Guldoman
2024-12-02 15:21:52 +08:00
committed by takase1121
parent 8498a988e4
commit f6fd438b08
+4 -4
View File
@@ -135,12 +135,12 @@ function tokenizer.tokenize(incoming_syntax, text, state, resume)
local res
local i = 1
if #incoming_syntax.patterns == 0 then
return { "normal", text }
end
state = state or string.char(0)
if #incoming_syntax.patterns == 0 then
return { "normal", text }, state
end
if resume then
res = resume.res
-- Remove "incomplete" tokens