Skip to content

Commit

Permalink
feat: support @ mode for cmdline
Browse files Browse the repository at this point in the history
Closes #696
  • Loading branch information
Saghen committed Dec 31, 2024
1 parent c2762c1 commit 4c2744d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/configuration/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ sources = {
-- Search forward and backward
if type == '/' or type == '?' then return { 'buffer' } end
-- Commands
if type == ':' then return { 'cmdline' } end
if type == ':' or type == '@' then return { 'cmdline' } end
return {}
end,

Expand Down
2 changes: 1 addition & 1 deletion lua/blink/cmp/config/sources.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ local sources = {
-- Search forward and backward
if type == '/' or type == '?' then return { 'buffer' } end
-- Commands
if type == ':' then return { 'cmdline' } end
if type == ':' or type == '@' then return { 'cmdline' } end
return {}
end,

Expand Down
2 changes: 1 addition & 1 deletion lua/blink/cmp/sources/cmdline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function cmdline:get_completions(context, callback)
end

local query = (text_before_argument .. current_arg_prefix):gsub([[\\]], [[\\\\]])
local completions = vim.fn.getcompletion(query, 'cmdline')
local completions = vim.fn.getcompletion(query, vim.fn.getcmdcompltype())

-- Special case for files, escape special characters
if vim.tbl_contains(constants.file_commands, arguments[1] or '') then
Expand Down

0 comments on commit 4c2744d

Please sign in to comment.