Skip to content

Commit

Permalink
fix #863
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Dec 24, 2021
1 parent 59a9b96 commit c6549d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion script/parser/guide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion script/parser/newparser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6549d9

Please sign in to comment.