Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lua/codeium/blink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ function M:get_completions(ctx, callback)
local line_ending = util.get_newline(bufnr)
local line_ending_len = utf8len(line_ending)
local editor_options = util.get_editor_options(bufnr)
local buf_name = vim.api.nvim_buf_get_name(bufnr)

if buf_name == "" then
callback(nil)
return function() end
end

-- We need to calculate the number of bytes prior to the current character,
-- that starts with all the prior lines
Expand Down Expand Up @@ -157,7 +163,7 @@ function M:get_completions(ctx, callback)
editor_language = filetype,
language = language,
cursor_position = { row = cursor[1] - 1, col = cursor[2] },
absolute_uri = util.get_uri(vim.api.nvim_buf_get_name(bufnr)),
absolute_uri = util.get_uri(buf_name),
workspace_uri = util.get_uri(util.get_project_root()),
line_ending = line_ending,
cursor_offset = cursor_offset,
Expand Down