fix(copilot): work-around Neovim bug. Fixes #656
This commit is contained in:
lua/lazyvim
@ -28,8 +28,8 @@ return {
|
|||||||
return icon .. (status.message or "")
|
return icon .. (status.message or "")
|
||||||
end,
|
end,
|
||||||
cond = function()
|
cond = function()
|
||||||
local clients = vim.lsp.get_active_clients({ name = "copilot", bufnr = 0 })
|
local ok, clients = pcall(vim.lsp.get_active_clients, { name = "copilot", bufnr = 0 })
|
||||||
return #clients > 0
|
return ok and #clients > 0
|
||||||
end,
|
end,
|
||||||
color = function()
|
color = function()
|
||||||
local status = require("copilot.api").status.data
|
local status = require("copilot.api").status.data
|
||||||
@ -76,7 +76,7 @@ return {
|
|||||||
["<CR>"] = function(...)
|
["<CR>"] = function(...)
|
||||||
local entry = cmp.get_selected_entry()
|
local entry = cmp.get_selected_entry()
|
||||||
if entry and entry.source.name == "copilot" then
|
if entry and entry.source.name == "copilot" then
|
||||||
return confirm_copilot(...)
|
-- return confirm_copilot(...)
|
||||||
end
|
end
|
||||||
return confirm(...)
|
return confirm(...)
|
||||||
end,
|
end,
|
||||||
|
@ -215,7 +215,7 @@ To use this, add it to your **lazy.nvim** imports:
|
|||||||
```lua title="lua/config/lazy.lua" {4}
|
```lua title="lua/config/lazy.lua" {4}
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
{ "folke/LazyVim", import = "lazyvim.plugins" },
|
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||||
{ import = "%s" },
|
{ import = "%s" },
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user