diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 0603b20d..1c9ad419 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -95,12 +95,13 @@ function M.expand(snippet) -- See: https://github.com/LazyVim/LazyVim/issues/3199 local session = vim.snippet.active() and vim.snippet._session or nil - local ok = pcall(vim.snippet.expand, snippet) + local ok, err = pcall(vim.snippet.expand, snippet) if not ok then local fixed = M.snippet_fix(snippet) ok = pcall(vim.snippet.expand, fixed) - local msg = ok and "Failed to parse snippet,\nbut was able to fix it automatically." or "Failed to parse snippet." + local msg = ok and "Failed to parse snippet,\nbut was able to fix it automatically." + or ("Failed to parse snippet.\n" .. err) LazyVim[ok and "warn" or "error"]( ([[%s