fix(nvim): copilot_cmp behaviour
This commit is contained in:
parent
0cd4cf6d40
commit
d123d084d7
|
@ -68,14 +68,26 @@ cmp.setup({
|
||||||
}),
|
}),
|
||||||
sorting = {
|
sorting = {
|
||||||
comparators = {
|
comparators = {
|
||||||
cmp.config.compare.offset,
|
|
||||||
cmp.config.compare.exact,
|
cmp.config.compare.exact,
|
||||||
|
require("copilot_cmp.comparators").prioritize,
|
||||||
|
cmp.config.compare.offset,
|
||||||
cmp.config.compare.score,
|
cmp.config.compare.score,
|
||||||
cmp.config.compare.recently_used,
|
cmp.config.compare.recently_used,
|
||||||
-- require("cmp-under-comparator").under,
|
cmp.config.compare.locality,
|
||||||
cmp.config.compare.kind,
|
cmp.config.compare.kind,
|
||||||
|
cmp.config.compare.sort_text,
|
||||||
|
cmp.config.compare.length,
|
||||||
|
cmp.config.compare.order,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- https://github.com/hrsh7th/nvim-cmp/wiki/Advanced-techniques#disabling-completion-in-certain-contexts-such-as-comments
|
||||||
|
enabled = function()
|
||||||
|
local context = require("cmp.config.context")
|
||||||
|
if vim.api.nvim_get_mode().mode == "c" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
|
||||||
|
end,
|
||||||
formatting = {
|
formatting = {
|
||||||
fields = { "kind", "abbr", "menu" },
|
fields = { "kind", "abbr", "menu" },
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue