summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-06 00:25:14 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-06 00:25:14 +0800
commit21d1b8fd59bcfff3797453e787a1151f8987ae0b (patch)
tree0e146319e02373c2a90d307c1c06e4af562c57b5 /script/parser
parentd308b37e66d01737d5079b5a062127cdfcba47b1 (diff)
parent63b360689f0c2c99a1ae410518f6866f49972f98 (diff)
downloadlua-language-server-21d1b8fd59bcfff3797453e787a1151f8987ae0b.zip
Merge commit '63b360689f0c2c99a1ae410518f6866f49972f98' into 3.0
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 92e4edab..2de1ac22 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -800,6 +800,9 @@ function m.offsetToPosition(state, offset)
end
function m.getLineRange(state, row)
+ if not state.lines[row] then
+ return 0
+ end
local nextLineStart = state.lines[row + 1] or #state.lua
for i = nextLineStart - 1, state.lines[row], -1 do
local w = state.lua:sub(i, i)