Skip to content

Commit

Permalink
fix(cmp): unlist copilot-chat buffer after cmp item acceptance
Browse files Browse the repository at this point in the history
- nvim-cmp always sets buf to listed anytime you accept a cmp item
  • Loading branch information
GitMurf committed May 30, 2024
1 parent 60f53cf commit 7b804bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/CopilotChat/integrations/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ function Source:complete(params, callback)
callback({ items = items })
end

---@param completion_item lsp.CompletionItem
---@param callback fun(completion_item: lsp.CompletionItem|nil)
function Source:execute(completion_item, callback)
callback(completion_item)
vim.api.nvim_set_option_value('buflisted', false, { buf = 0 })
end

local M = {}

--- Setup the nvim-cmp source for copilot-chat window
Expand Down

0 comments on commit 7b804bf

Please sign in to comment.