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: #18411
closes: #20090
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
-*todo.txt* For Vim version 9.2. Last change: 2026 Feb 14
+*todo.txt* For Vim version 9.2. Last change: 2026 Apr 29
VIM REFERENCE MANUAL by Bram Moolenaar
Add an option to restrict 'incsearch' to not scroll the view. (Tavis Ormandy)
-Remove SPACE_IN_FILENAME ? It is only used for completion.
-
When 'term' starts with "foot" then default t_TI and t_TE to the values used
for the builtin xterm termcap.
- Removed the Wayland focus steal feature 'wlsteal', since it causes too many
issues and can now be re-implemted using the |clipboard-providers| feature
if needed, see |wayland-primary-selection| for an example.
+- On Unix, filename completion for single-file Ex commands now treats embedded
+ whitespace as part of the filename, like on other platforms.
+
*added-9.3*
Added ~
// An argument can contain just about everything, except
// characters that end the command and white space.
else if (c == '|' || c == '\n' || c == '"' || (VIM_ISWHITE(c)
-#ifdef SPACE_IN_FILENAME
&& (!(eap != NULL && (eap->argt & EX_NOSPC)) || usefilter)
-#endif
))
{
len = 0; // avoid getting stuck when space is in 'isfname'
*/
#define CASE_INSENSITIVE_FILENAME // ignore case when comparing file names
-#define SPACE_IN_FILENAME
#define USE_FNAME_CASE // adjust case of file names
#define USE_TERM_CONSOLE
#define HAVE_AVAIL_MEM
#define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
#define CASE_INSENSITIVE_FILENAME // ignore case when comparing file names
-#define SPACE_IN_FILENAME
#define BACKSLASH_IN_FILENAME
#define USE_CRNL // lines end in CR-NL instead of NL
#define HAVE_DUP // have dup()
#define USE_EXE_NAME // to find $VIM
#define CASE_INSENSITIVE_FILENAME // ignore case when comparing file names
-#define SPACE_IN_FILENAME
#define USE_FNAME_CASE // make ":e os_Mac.c" open the file in its
// original case, as "os_mac.c"
#include <decc$types.h> // Required early for large-file support
#define CASE_INSENSITIVE_FILENAME // Open VMS is case insensitive
-#define SPACE_IN_FILENAME // There could be space between user and passwd
#define FNAME_ILLEGAL "|*#?%" // Illegal characters in a file name
#define BINARY_FILE_IO // Use binary fileio
#define USE_GETCWD
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
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 416,
/**/
415,
/**/