diff --git a/lua/lazyvim/plugins/extras/coding/mini-snippets.lua b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua index 5ce82c80..d0a747a8 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-snippets.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua @@ -140,21 +140,25 @@ return { end -- Standalone -- + local blink = require("blink.cmp") expand_select_override = function(snippets, insert) -- Schedule, otherwise blink's virtual text is not removed on vim.ui.select - require("blink.cmp").cancel() + blink.cancel() vim.schedule(function() MiniSnippets.default_select(snippets, insert) end) end -- -- Blink performs a require on blink.cmp.sources.snippets.default - -- By removing the source, the default engine will not be used + -- By removing the source, that default engine will not be used opts.sources.default = vim.tbl_filter(function(source) return source ~= "snippets" end, opts.sources.default) opts.snippets = { -- need to repeat blink's preset here - expand = expand_from_lsp, + expand = function(snippet) + expand_from_lsp(snippet) + blink.resubscribe() + end, active = function() return MiniSnippets.session.get(false) ~= nil end,