diff options
Diffstat (limited to 'script/core/highlight.lua')
-rw-r--r-- | script/core/highlight.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script/core/highlight.lua b/script/core/highlight.lua index 80088680..72214672 100644 --- a/script/core/highlight.lua +++ b/script/core/highlight.lua @@ -63,7 +63,7 @@ local function checkInIf(state, source, text, position) local endA = endB - #'end' + 1 if position >= source.finish - #'end' and position <= source.finish - and text:sub(endA, endB) == 'end' then + and text and text:sub(endA, endB) == 'end' then return true end -- 检查每个子模块 @@ -83,7 +83,7 @@ local function makeIf(state, source, text, callback) -- end local endB = guide.positionToOffset(state, source.finish) local endA = endB - #'end' + 1 - if text:sub(endA, endB) == 'end' then + if text and text:sub(endA, endB) == 'end' then callback(source.finish - #'end', source.finish) end -- 每个子模块 |