Skip to content

Commit 5516b5a

Browse files
chore(build): auto-generate docs
1 parent 769f6cf commit 5516b5a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

docs/extras/coding/mini-snippets.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,21 +257,25 @@ opts = function(_, opts)
257257
end
258258

259259
-- Standalone --
260+
local blink = require("blink.cmp")
260261
expand_select_override = function(snippets, insert)
261262
-- Schedule, otherwise blink's virtual text is not removed on vim.ui.select
262-
require("blink.cmp").cancel()
263+
blink.cancel()
263264
vim.schedule(function()
264265
MiniSnippets.default_select(snippets, insert)
265266
end)
266267
end
267268
--
268269
-- 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
270271
opts.sources.default = vim.tbl_filter(function(source)
271272
return source ~= "snippets"
272273
end, opts.sources.default)
273274
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,
275279
active = function()
276280
return MiniSnippets.session.get(false) ~= nil
277281
end,
@@ -299,21 +303,25 @@ end
299303
end
300304

301305
-- Standalone --
306+
local blink = require("blink.cmp")
302307
expand_select_override = function(snippets, insert)
303308
-- Schedule, otherwise blink's virtual text is not removed on vim.ui.select
304-
require("blink.cmp").cancel()
309+
blink.cancel()
305310
vim.schedule(function()
306311
MiniSnippets.default_select(snippets, insert)
307312
end)
308313
end
309314
--
310315
-- 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
312317
opts.sources.default = vim.tbl_filter(function(source)
313318
return source ~= "snippets"
314319
end, opts.sources.default)
315320
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,
317325
active = function()
318326
return MiniSnippets.session.get(false) ~= nil
319327
end,

0 commit comments

Comments
 (0)