mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 17:28:57 +02:00
fix(cmp): fix cmp's broken snippet parsing functionality. Fixes #3266
This commit is contained in:
parent
8ba7c64a7d
commit
2bae438570
1 changed files with 10 additions and 0 deletions
|
@ -71,6 +71,16 @@ return {
|
||||||
for _, source in ipairs(opts.sources) do
|
for _, source in ipairs(opts.sources) do
|
||||||
source.group_index = source.group_index or 1
|
source.group_index = source.group_index or 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local parse = require("cmp.utils.snippet").parse
|
||||||
|
require("cmp.utils.snippet").parse = function(input)
|
||||||
|
local ok, ret = pcall(parse, input)
|
||||||
|
if ok then
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
return LazyVim.cmp.snippet_preview(input)
|
||||||
|
end
|
||||||
|
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
cmp.setup(opts)
|
cmp.setup(opts)
|
||||||
cmp.event:on("confirm_done", function(event)
|
cmp.event:on("confirm_done", function(event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue