fix(copilot): work-around Neovim bug. Fixes #656

This commit is contained in:
Folke Lemaitre
2023-04-21 18:27:15 +02:00
parent eb92903342
commit 4379ae8ab9
2 changed files with 4 additions and 4 deletions

View File

@ -28,8 +28,8 @@ return {
return icon .. (status.message or "")
end,
cond = function()
local clients = vim.lsp.get_active_clients({ name = "copilot", bufnr = 0 })
return #clients > 0
local ok, clients = pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 })
return ok and #clients > 0
end,
color = function()
local status = require("copilot.api").status.data
@ -76,7 +76,7 @@ return {
["<CR>"] = function(...)
local entry = cmp.get_selected_entry()
if entry and entry.source.name == "copilot" then
return confirm_copilot(...)
-- return confirm_copilot(...)
end
return confirm(...)
end,