mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
vim-patch:9.2.0416: Unix: filename completion splits at space for single-file Ex commands (#39520)
Problem: SPACE_IN_FILENAME is defined on most platforms but not on Unix.
As a result, set_context_for_wildcard_arg() on Unix always resets the
completion pattern at white space for Ex commands that take a
single file argument.
Solution: Drop the SPACE_IN_FILENAME ifdef (Maxim Kim)
fixes: vim/vim#18411
closes: vim/vim#20090
c2bda0add9
Co-authored-by: Maxim Kim <habamax@gmail.com>
This commit is contained in:
@@ -1586,7 +1586,9 @@ static void set_context_for_wildcard_arg(exarg_T *eap, const char *arg, bool use
|
||||
in_quote = !in_quote;
|
||||
// An argument can contain just about everything, except
|
||||
// characters that end the command and white space.
|
||||
} else if (c == '|' || c == '\n' || c == '"' || ascii_iswhite(c)) {
|
||||
} else if (c == '|' || c == '\n' || c == '"'
|
||||
|| (ascii_iswhite(c) && (!(eap != NULL && (eap->argt & EX_NOSPC))
|
||||
|| usefilter))) {
|
||||
len = 0; // avoid getting stuck when space is in 'isfname'
|
||||
while (*p != NUL) {
|
||||
c = utf_ptr2char(p);
|
||||
|
||||
@@ -5321,6 +5321,22 @@ func Test_rulerformat_empty()
|
||||
set rulerformat&
|
||||
endfunc
|
||||
|
||||
func Test_cmdline_complete_with_space()
|
||||
call mkdir('Xspc', 'R')
|
||||
let save_cwd = getcwd()
|
||||
cd Xspc
|
||||
call writefile([], 'foo bar')
|
||||
call writefile([], 'baz')
|
||||
call writefile([], 'bz')
|
||||
|
||||
" This should expand to foo\ bar, not add 3 space separated
|
||||
" files: foo baz bz
|
||||
call feedkeys(":badd foo b\<C-A>\<C-B>\"\<CR>", 'xt')
|
||||
call assert_equal('"badd foo\ bar', @:)
|
||||
|
||||
call chdir(save_cwd)
|
||||
endfunc
|
||||
|
||||
func Test_wildmode_noinsert()
|
||||
command! -nargs=1 -complete=custom,T MyCmd echo
|
||||
func T(a, c, p)
|
||||
|
||||
Reference in New Issue
Block a user