Skip to content

Commit

Permalink
#398 try fix offset of eof
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Feb 26, 2021
1 parent ffca749 commit 4e806aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ function m.offset(uri, position, isFinish)
local start = guide.lineRange(lines, row)
local offset
if start <= 0 or start > #text then
offset = #text
offset = #text + 1
else
offset = utf8.offset(text, position.character + 1, start) or #text
end
Expand Down Expand Up @@ -572,7 +572,7 @@ function m.offsetOfWord(uri, position)
local start = guide.lineRange(lines, row)
local offset
if start <= 0 or start > #text then
offset = #text
offset = #text + 1
else
offset = utf8.offset(text, position.character + 1, start) or #text
end
Expand Down

0 comments on commit 4e806aa

Please sign in to comment.