cmp-buffer icon indicating copy to clipboard operation
cmp-buffer copied to clipboard

Does not work well with `set nohidden`

Open skanev opened this issue 3 years ago • 1 comments

First of all, great plugin, I really love nvim-cmp.

So, I tried to enable completion for multiple buffers with:

get_bufnrs = function() return vim.api.nvim_list_bufs() end

Didn't work. Or rather, was weirdly buggy and sometimes worked, sometimes didn't. Long story short, the mechanism for indexing files doesn't work unless set hidden is set. I spent a few hours debugging until I figured out why the source get buffers with no words in them.

I appreciate that making it work for set nohidden will add a lot of complexity, and that maybe set hidden is a better default. May I suggest it's at least added to the README that is required for the plugin to function?

skanev avatar Nov 17 '22 18:11 skanev

:set hidden unloads the hidden buffers when they are abandoned, and unloading the buffer frees its contents from the memory, so cmp-buffer simply cannot see what's inside the buffer.

dmitmel avatar May 16 '25 16:05 dmitmel