Skip to content

Commit 7b0548e

Browse files
committed
fix(cmdline): support wildcard completion in file
Closes #2106
1 parent 4e9edba commit 7b0548e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/blink/cmp/sources/cmdline/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ local function smart_split(context, is_path_completion)
2020
-- Checks for common Vim expressions: %, #, %:h, %:p, etc.
2121
return vim.regex([[%\%(:[phtrwe~.]\)\?]]):match_str(line) ~= nil
2222
end
23+
local function contains_wildcard(line) return line:find('[%*%?%[%]]') ~= nil end
2324

24-
if is_path_completion and not contains_vim_expr(line) then
25+
if is_path_completion and not contains_vim_expr(line) and not contains_wildcard(line) then
2526
-- Split the line into tokens, respecting escaped spaces in paths
2627
local tokens = path_lib:split_unescaped(line:gsub('^%s+', ''))
2728
local cmd = tokens[1]

0 commit comments

Comments
 (0)