diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-12-24 14:36:14 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-12-24 14:36:26 +0800 |
commit | c6549d9dd8eb8dfca684f6a25dc7e1c01dcaf358 (patch) | |
tree | 5df50fafc639efef20b07938d299776a36cf2418 /script/parser | |
parent | 59a9b96ccc7c251ec46929667c3decc10ba42dd2 (diff) | |
download | lua-language-server-c6549d9dd8eb8dfca684f6a25dc7e1c01dcaf358.zip |
fix #863
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 2 | ||||
-rw-r--r-- | script/parser/newparser.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index d55ba099..544f3eaa 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -781,7 +781,7 @@ function m.offsetToPositionByLines(lines, offset) row = (left + right) // 2 if row == left then if right ~= left then - if lines[right] <= offset then + if lines[right] - 1 <= offset then row = right end end diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index 15d2d600..c2ea8d13 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -537,7 +537,7 @@ local function skipComment(isAction) State.comms[#State.comms+1] = { type = chead and 'comment.cshort' or 'comment.short', start = left, - finish = getPosition(Tokens[Index], 'right'), + finish = lastRightPosition(), text = ssub(Lua, start + 2, Tokens[Index] and (Tokens[Index] - 1) or #Lua), } return true |