Closed shaman-yellow closed 5 months ago
nvim-cmp
receives the arguments in the correct order from cmp-nvim-r
. You could try to configure the sorting
or sorting.comparators
argument in nvim-cmp
config so that at least the order of items from cmp-nvim-r
is preserved. Please, post here if you have success doing it.
Thanks! After trying, I solved the trouble that had been bothering me for a long time!
cmp.setup({
-- ...
-- before is the other configure
sources = {
{ name = 'cmp_nvim_r' },
},
sorting = {
comparators = {
-- this function seems to work well
cmp.config.compare.order,
},
},
})
Thank you! I will try your solution too.
I have always had a question:
Nvim-R
usescmp
to provide function parameter completion, but in many cases the order of the parameters is not followed. Let me give you an example and create the following function:The true order is:
x, decreasing = F, as.factor = F
. However, the completion candidates order is:x, as.factor = F, decreasing = F
. Many times, I am deceived by the completion. Is there any way to adjust this?