Skip to content

Commit

Permalink
fix: add exclusion for custom,v:lua completions (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
pynappo authored Jan 17, 2025
1 parent 44a67b3 commit cee556e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/blink/cmp/sources/cmdline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ function cmdline:get_completions(context, callback)
local completion_func = completion_args[2]

-- Handle custom completions explicitly, since otherwise they won't work in input() mode (getcmdtype() == '@')
-- TODO: however, we cannot handle s: and <sid> completions. is there a better solution here where we can get
-- completions in input() mode without calling ourselves?
-- TODO: however, we cannot handle v:lua, s:, and <sid> completions. is there a better solution here where we can
-- get completions in input() mode without calling ourselves?
if
vim.startswith(completion_type, 'custom')
and not vim.startswith(completion_func, 's:')
and not vim.startswith(completion_func, 'v:lua')
and not vim.startswith(completion_func, '<sid>')
then
completions = vim.fn.call(completion_func, { current_arg_prefix, vim.fn.getcmdline(), vim.fn.getcmdpos() })
Expand Down

0 comments on commit cee556e

Please sign in to comment.