Closed mjkx5 closed 2 months ago
What's the effect? I can't see my desired effect.
It is the first picture which is add this config. It is the second picture which is not add the config.
Default: vim.api.nvim_get_current_buf() -> only read current buffer to completion
the modified config -> reading all buffer to completion.
Understood. Useful feature and thanks for your contribution!
Hmm, but wouldn't this potentially lead to some inappropriate suggestions, especially when buffers are open for different file formats? [e.g., cmp-buffer
might suggest @autoreleasepool
in a buffer containing C source code (which is invalid) because the project also includes Objective-C files.] Plus, there could be performance implications when too many buffers are open 🤔
EDIT: Was thinking maybe having language servers handle file interactions would be better?
IMO the range of candidates will decrease during the input process. This function can be seen as a supliment of lsp suggestion, specically for the text input situation like markdown.
using that, buffer completion include all buffer, not only one buffer.
https://github.com/hrsh7th/cmp-buffer
get_bufnrs (type: fun(): number[]) Default: function() return { vim.api.nvim_get_current_buf() } end
A function that specifies the buffer numbers to complete.