mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-30 04:24:35 +02:00
fix(copilot): work-around Neovim bug. Fixes #656
This commit is contained in:
parent
eb92903342
commit
4379ae8ab9
2 changed files with 4 additions and 4 deletions
|
@ -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" },
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue