mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
patch 9.2.0416: Unix: filename completion splits at space for single-file Ex commands
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>
This commit is contained in:
committed by
Christian Brabandt
parent
6453a7c440
commit
c2bda0add9
@@ -1,4 +1,4 @@
|
||||
*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
|
||||
@@ -421,8 +421,6 @@ more information.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -52642,6 +52642,9 @@ Changed ~
|
||||
- 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 ~
|
||||
|
||||
@@ -1832,9 +1832,7 @@ set_context_for_wildcard_arg(
|
||||
// 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'
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
@@ -109,7 +109,6 @@
|
||||
#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()
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
|
||||
#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"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#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
|
||||
|
||||
@@ -5400,4 +5400,20 @@ 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
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
416,
|
||||
/**/
|
||||
415,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user