@@ -257,21 +257,25 @@ opts = function(_, opts)
257
257
end
258
258
259
259
-- Standalone --
260
+ local blink = require (" blink.cmp" )
260
261
expand_select_override = function (snippets , insert )
261
262
-- Schedule, otherwise blink's virtual text is not removed on vim.ui.select
262
- require ( " blink.cmp " ) .cancel ()
263
+ blink .cancel ()
263
264
vim .schedule (function ()
264
265
MiniSnippets .default_select (snippets , insert )
265
266
end )
266
267
end
267
268
--
268
269
-- Blink performs a require on blink.cmp.sources.snippets.default
269
- -- By removing the source, the default engine will not be used
270
+ -- By removing the source, that default engine will not be used
270
271
opts .sources .default = vim .tbl_filter (function (source )
271
272
return source ~= " snippets"
272
273
end , opts .sources .default )
273
274
opts .snippets = { -- need to repeat blink's preset here
274
- expand = expand_from_lsp ,
275
+ expand = function (snippet )
276
+ expand_from_lsp (snippet )
277
+ blink .resubscribe ()
278
+ end ,
275
279
active = function ()
276
280
return MiniSnippets .session .get (false ) ~= nil
277
281
end ,
@@ -299,21 +303,25 @@ end
299
303
end
300
304
301
305
-- Standalone --
306
+ local blink = require (" blink.cmp" )
302
307
expand_select_override = function (snippets , insert )
303
308
-- Schedule, otherwise blink's virtual text is not removed on vim.ui.select
304
- require ( " blink.cmp " ) .cancel ()
309
+ blink .cancel ()
305
310
vim .schedule (function ()
306
311
MiniSnippets .default_select (snippets , insert )
307
312
end )
308
313
end
309
314
--
310
315
-- Blink performs a require on blink.cmp.sources.snippets.default
311
- -- By removing the source, the default engine will not be used
316
+ -- By removing the source, that default engine will not be used
312
317
opts .sources .default = vim .tbl_filter (function (source )
313
318
return source ~= " snippets"
314
319
end , opts .sources .default )
315
320
opts .snippets = { -- need to repeat blink's preset here
316
- expand = expand_from_lsp ,
321
+ expand = function (snippet )
322
+ expand_from_lsp (snippet )
323
+ blink .resubscribe ()
324
+ end ,
317
325
active = function ()
318
326
return MiniSnippets .session .get (false ) ~= nil
319
327
end ,
0 commit comments