summaryrefslogtreecommitdiff
path: root/script/parser/guide.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-10-11 17:23:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-10-11 17:23:29 +0800
commit9d178dddbc3543ed6faa9bd9c23bed517774393f (patch)
treecafce119e29ebbc6b1d4dbe1a5163fa5913663a1 /script/parser/guide.lua
parentfba7d2df87e418b93c2c45531de2f776a8747b20 (diff)
downloadlua-language-server-9d178dddbc3543ed6faa9bd9c23bed517774393f.zip
fix
Diffstat (limited to 'script/parser/guide.lua')
-rw-r--r--script/parser/guide.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 4046cd69..b6cce241 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -763,7 +763,7 @@ end
function m.positionToOffsetByLines(lines, position)
local row, col = m.rowColOf(position)
- return lines[row] + col - 1
+ return (lines[row] or 1) + col - 1
end
--- 返回全文光标位置