summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/proto/converter.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/proto/converter.lua b/script/proto/converter.lua
index af75f080..2d3053b9 100644
--- a/script/proto/converter.lua
+++ b/script/proto/converter.lua
@@ -69,7 +69,7 @@ local function rawUnpackPosition(uri, position)
if text then
local lineOffset = state.lines[row]
local textOffset = utf8.offset(text, col + 1, lineOffset)
- if textOffset then
+ if textOffset and lineOffset then
col = textOffset - lineOffset
end
end
@@ -86,7 +86,7 @@ local function diffedUnpackPosition(uri, position)
if text then
local lineOffset = originLines[row]
local textOffset = utf8.offset(text, col + 1, lineOffset)
- if textOffset then
+ if textOffset and lineOffset then
col = textOffset - lineOffset
end
end