File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
lua/blink/cmp/sources/cmdline Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,9 @@ function cmdline:get_completions(context, callback)
4141 local is_path_completion = vim .tbl_contains (constants .completion_types .path , completion_type )
4242 local is_buffer_completion = vim .tbl_contains (constants .completion_types .buffer , completion_type )
4343 local is_filename_modifier_completion = cmdline_utils .contains_filename_modifiers (context .line )
44+ local is_wildcard_completion = cmdline_utils .contains_wildcard (context .line )
4445
45- local should_split_path = (is_path_completion or is_buffer_completion ) and not is_filename_modifier_completion
46+ local should_split_path = (is_path_completion or is_buffer_completion ) and not is_filename_modifier_completion and not is_wildcard_completion
4647 local context_line , arguments = cmdline_utils .smart_split (context .line , should_split_path )
4748 local before_cursor = context_line :sub (1 , context .cursor [2 ])
4849 local _ , args_before_cursor = cmdline_utils .smart_split (before_cursor , should_split_path )
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ function utils.contains_filename_modifiers(line)
3636 return vim .regex (pat ):match_str (line ) ~= nil
3737end
3838
39+ -- Detects whether the provided line contains wildcard, see :h wildcard
40+ --- @param line string
41+ --- @return boolean
42+ function utils .contains_wildcard (line ) return line :find (' [%*%?%[%]]' ) ~= nil end
43+
3944--- Split the command line into arguments, handling path escaping and trailing spaces.
4045--- For path completions, split by paths and normalize each one if needed.
4146--- For other completions, splits by spaces and preserves trailing empty arguments.
You can’t perform that action at this time.
0 commit comments