Skip to content

Commit

Permalink
feat: add callback option to cmp.show
Browse files Browse the repository at this point in the history
Closes #806
  • Loading branch information
Saghen committed Dec 29, 2024
1 parent 434ea2b commit 33b82e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/blink/cmp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function cmp.is_visible()
or require('blink.cmp.completion.windows.ghost_text').is_open()
end

--- @params opts? { providers?: string[] }
--- @params opts? { providers?: string[], callback?: fun() }
function cmp.show(opts)
if require('blink.cmp.completion.windows.menu').win:is_open() and not (opts and opts.providers) then return end

Expand All @@ -48,6 +48,7 @@ function cmp.show(opts)
providers = opts and opts.providers,
trigger_kind = 'manual',
})
if opts and opts.callback then opts.callback() end
end)
return true
end
Expand Down

0 comments on commit 33b82e5

Please sign in to comment.