Skip to content

Commit c6549d9

Browse files
committed
fix #863
1 parent 59a9b96 commit c6549d9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 2.5.6
44
* `CHG` diagnostic: now syntax errors in `LuaDoc` are shown as `Warning`
5+
* `FIX` [#863](https://github.com/sumneko/lua-language-server/issues/863)
56
* `FIX` return type of `math.floor`
67
* `FIX` runtime errors
78

script/parser/guide.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ function m.offsetToPositionByLines(lines, offset)
781781
row = (left + right) // 2
782782
if row == left then
783783
if right ~= left then
784-
if lines[right] <= offset then
784+
if lines[right] - 1 <= offset then
785785
row = right
786786
end
787787
end

script/parser/newparser.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ local function skipComment(isAction)
537537
State.comms[#State.comms+1] = {
538538
type = chead and 'comment.cshort' or 'comment.short',
539539
start = left,
540-
finish = getPosition(Tokens[Index], 'right'),
540+
finish = lastRightPosition(),
541541
text = ssub(Lua, start + 2, Tokens[Index] and (Tokens[Index] - 1) or #Lua),
542542
}
543543
return true

0 commit comments

Comments
 (0)