patch 9.1.0761: :cd completion fails on Windows with backslash in path
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>
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 4fec1c1..2b392c5 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -3920,4 +3920,15 @@
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