Enable/disable copilot suggestions #226
-
Hi, I’m trying to integrate with copilot.lua. I have seen a snippet in this Pull Request that I would like to integrate. When using local autocomplete = require("blink.cmp.windows.autocomplete")
autocomplete.listen_on_open(function()
require("copilot.suggestion").dismiss()
vim.api.nvim_buf_set_var(0, "copilot_suggestion_hidden", true)
end)
autocomplete.listen_on_close(function()
vim.api.nvim_buf_set_var(0, "copilot_suggestion_hidden", false)
end) However, doing this I noticed that the callback seems to be triggered each time the autocomplete could be opened and not each time it is actually opened because I have |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
For |
Beta Was this translation helpful? Give feedback.
-
This is how I implemented it, seems to be working well. vim.api.nvim_create_autocmd('User', {
pattern = 'BlinkCmpCompletionMenuOpen',
callback = function()
vim.b.copilot_suggestion_hidden = true
end,
})
vim.api.nvim_create_autocmd('User', {
pattern = 'BlinkCmpCompletionMenuClose',
callback = function()
vim.b.copilot_suggestion_hidden = false
end,
})
Thanks for the amazing plugin @Saghen. |
Beta Was this translation helpful? Give feedback.
This is how I implemented it, seems to be working well.
Thanks for the amazing plugin @Saghen.