Skip to content

Commit

Permalink
fix: update cursor position calculation (#229)
Browse files Browse the repository at this point in the history
Lua arrays start from 1, but server requires indexes starting from 0
  • Loading branch information
aliaksandr-trush committed Sep 25, 2024
1 parent f1b1f2c commit e638b93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/codeium/source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function Source:complete(params, callback)
text = text,
editor_language = filetype,
language = language,
cursor_position = { row = cursor.row, col = cursor.col },
cursor_position = { row = cursor.row - 1, col = cursor.col - 1 },
absolute_uri = 'file://' .. vim.api.nvim_buf_get_name(bufnr),
workspace_uri = 'file://' .. util.get_relative_path(bufnr),
line_ending = line_ending,
Expand All @@ -205,6 +205,7 @@ function Source:complete(params, callback)
end
end
)

end

return Source

0 comments on commit e638b93

Please sign in to comment.