Skip to content

Commit

Permalink
fix(copilot): work-around Neovim bug. Fixes #656
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 21, 2023
1 parent eb92903 commit 4379ae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lua/lazyvim/plugins/extras/coding/copilot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lua/lazyvim/util/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ To use this, add it to your **lazy.nvim** imports:
```lua title="lua/config/lazy.lua" {4}
require("lazy").setup({
spec = {
{ "folke/LazyVim", import = "lazyvim.plugins" },
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "%s" },
{ import = "plugins" },
},
Expand Down

0 comments on commit 4379ae8

Please sign in to comment.