diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-17 21:07:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-17 21:07:55 +0800 |
commit | 84148fbedef3f3ae04552dcf3218e05027c17625 (patch) | |
tree | 8c5c9f7b693c0d99282349f686660f55a01ad5ca /script/parser/guide.lua | |
parent | db328eeed2ab7b67a179bb14edfdd0ad03c63bb1 (diff) | |
download | lua-language-server-84148fbedef3f3ae04552dcf3218e05027c17625.zip |
update
Diffstat (limited to 'script/parser/guide.lua')
-rw-r--r-- | script/parser/guide.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index e2262cfd..af623753 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -763,7 +763,7 @@ end function m.positionToOffset(state, position) local lines = state.lines local row, col = m.rowColOf(position) - return (lines[row] or 1) + col - 1 + return lines[row] + col - 1 end function m.offsetToPosition(state, offset) @@ -788,7 +788,7 @@ function m.offsetToPosition(state, offset) left = row end end - local col = offset - (lines[row] or 1) + local col = offset - lines[row] + 1 return m.positionOf(row, col) end |