diff options
-rw-r--r-- | changelog.md | 2 | ||||
-rw-r--r-- | script/core/semantic-tokens.lua | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/changelog.md b/changelog.md index 325a0a15..c17cdff0 100644 --- a/changelog.md +++ b/changelog.md @@ -4,9 +4,11 @@ * `FIX` commandline parameter `checklevel` may not work * `FIX` [#2036] * `FIX` [#2037] +* `FIX` [#2081] [#2036]: https://github.com/LuaLS/lua-language-server/issues/2036 [#2037]: https://github.com/LuaLS/lua-language-server/issues/2037 +[#2081]: https://github.com/LuaLS/lua-language-server/issues/2081 ## 3.6.18 `2023-3-23` diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index 0e27e8b8..4d191b69 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -711,7 +711,7 @@ local function buildTokens(state, results) local lastLine = 0 local lastStartChar = 0 local index = 0 - for _, source in ipairs(results) do + for i, source in ipairs(results) do local startPos = source.start local finishPos = source.finish local line = startPos.line @@ -720,7 +720,7 @@ local function buildTokens(state, results) local deltaStartChar if deltaLine == 0 then deltaStartChar = startChar - lastStartChar - if deltaStartChar == 0 then + if deltaStartChar == 0 and i > 1 then goto continue end else |