summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2024-10-06 16:34:20 +0200
committerChristian Brabandt <cb@256bit.org>2024-10-06 16:34:20 +0200
commit1a31c430bb175144d097ca607dbe10d7960f372a (patch)
tree4c9b0ff24d326a97136418d58c99ce00acef5bc3
parentd4ad4c9b3e9f9fd8ba1a7d0d61ec5839df645635 (diff)
patch 9.1.0761: :cd completion fails on Windows with backslash in pathv9.1.0761
Problem: :cd completion fails on Windows with backslash in path Solution: switch no_bslash argument to FALSE in file_pat_to_reg_pat() Note: only fixes the problem on Windows. For Unix, we still need to escape backslashes since those are taken as regex atoms (and could be invalid regex atoms). fixes: #15643 closes: #15808 Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--src/fileio.c2
-rw-r--r--src/findfile.c2
-rw-r--r--src/testdir/test_cmdline.vim11
-rw-r--r--src/version.c2
4 files changed, 16 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 5fee4e0be9..41e5b5dbf7 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5570,6 +5570,8 @@ match_file_list(char_u *list, char_u *sfname, char_u *ffname)
* allow_dirs, otherwise FALSE is put there -- webb.
* Handle backslashes before special characters, like "\*" and "\ ".
*
+ * no_bslash only makes a difference, when BACKSLASH_IN_FILENAME is defined
+ *
* Returns NULL when out of memory.
*/
char_u *
diff --git a/src/findfile.c b/src/findfile.c
index 4310a508c1..b6ee0920fd 100644
--- a/src/findfile.c
+++ b/src/findfile.c
@@ -2362,7 +2362,7 @@ uniquefy_paths(
file_pattern[0] = '*';
file_pattern[1] = NUL;
STRCAT(file_pattern, pattern);
- pat = file_pat_to_reg_pat(file_pattern, NULL, NULL, TRUE);
+ pat = file_pat_to_reg_pat(file_pattern, NULL, NULL, FALSE);
vim_free(file_pattern);
if (pat == NULL)
return;
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 4fec1c1c86..2b392c5532 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -3920,4 +3920,15 @@ func Test_ex_command_completion()
set cpo-=*
endfunc
+func Test_cd_bslsh_completion_windows()
+ CheckMSWindows
+ let save_shellslash = &shellslash
+ set noshellslash
+ call system('mkdir XXXa\_b')
+ defer delete('XXXa', 'rf')
+ call feedkeys(":cd XXXa\\_b\<C-A>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"cd XXXa\_b\', @:)
+ let &shellslash = save_shellslash
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index eff0cf824d..3b8e7fbe82 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 761,
+/**/
760,
/**/
759,