chore(nvim): allow completion in comments

This commit is contained in:
Rob Watson 2024-01-15 08:40:57 +01:00
parent 90ec768ab3
commit d16d653a85
1 changed files with 1 additions and 5 deletions

View File

@ -82,11 +82,7 @@ cmp.setup({
}, },
-- https://github.com/hrsh7th/nvim-cmp/wiki/Advanced-techniques#disabling-completion-in-certain-contexts-such-as-comments -- https://github.com/hrsh7th/nvim-cmp/wiki/Advanced-techniques#disabling-completion-in-certain-contexts-such-as-comments
enabled = function() enabled = function()
local context = require("cmp.config.context") return true
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, end,
formatting = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },