This commit is contained in:
Konstantin Labun
2023-05-01 07:23:02 -07:00
committed by GitHub
parent 524cc0ba61
commit 5547295bd0
2 changed files with 36 additions and 2 deletions

View File

@@ -62,11 +62,12 @@ entry.get_offset = function(self)
if range then
offset = self.context.cache:ensure('entry:' .. 'get_offset:' .. tostring(range.start.character), function()
for idx = range.start.character + 1, self.source_offset do
if not char.is_white(string.byte(self.context.cursor_line, idx)) then
local byte = string.byte(self.context.cursor_line, idx)
if byte ~= nil and not char.is_white(byte) then
return idx
end
end
return offset
return offset + 1
end)
end
else