diff --git a/lua/completion.lua b/lua/completion.lua index 7cfbf9c..91ceb5f 100644 --- a/lua/completion.lua +++ b/lua/completion.lua @@ -53,7 +53,9 @@ cmp.setup({ format = function(entry, vim_item) vim_item.abbr = string.sub(vim_item.abbr, 1, 20) vim_item.kind = string.sub(vim_item.kind, 1, 10) - -- vim_item.menu = string.sub(vim_item.menu, 1, 10) + if vim_item.menu then + vim_item.menu = string.sub(vim_item.menu, 1, 10) + end return vim_item end }