aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/eval/funcs.c2
-rw-r--r--src/nvim/ex_getln.c4
-rw-r--r--src/nvim/testdir/test_ins_complete.vim13
3 files changed, 11 insertions, 8 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index d2e9c68965..e5912efb13 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -4007,7 +4007,7 @@ static void f_glob(typval_T *argvars, typval_T *rettv, FunPtr fptr)
/// "globpath()" function
static void f_globpath(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
- int flags = 0; // Flags for globpath.
+ int flags = WILD_IGNORE_COMPLETESLASH; // Flags for globpath.
bool error = false;
// Return a string, or a list if the optional third argument is non-zero.
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index c56adc8bd4..d67e9b2d7e 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -4990,7 +4990,7 @@ ExpandFromContext (
char_u *pat,
int *num_file,
char_u ***file,
- int options /* EW_ flags */
+ int options // WILD_ flags
)
{
regmatch_T regmatch;
@@ -5053,7 +5053,7 @@ ExpandFromContext (
if (free_pat)
xfree(pat);
#ifdef BACKSLASH_IN_FILENAME
- if (p_csl[0] != NUL) {
+ if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) {
for (int i = 0; i < *num_file; i++) {
char_u *ptr = (*file)[i];
while (*ptr != NUL) {
diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim
index 45b0d159d4..be79b33f9c 100644
--- a/src/nvim/testdir/test_ins_complete.vim
+++ b/src/nvim/testdir/test_ins_complete.vim
@@ -367,17 +367,15 @@ endfunc
" Test for insert path completion with completeslash option
func Test_ins_completeslash()
- if !has('win32')
- return
- endif
-
+ CheckMSWindows
+
call mkdir('Xdir')
let orig_shellslash = &shellslash
set cpt&
new
-
+
set noshellslash
set completeslash=
@@ -408,7 +406,12 @@ func Test_ins_completeslash()
%bw!
call delete('Xdir', 'rf')
+ set noshellslash
+ set completeslash=slash
+ call assert_true(stridx(globpath(&rtp, 'syntax/*.vim', 1, 1)[0], '\') != -1)
+
let &shellslash = orig_shellslash
+ set completeslash=
endfunc
func Test_pum_with_folds_two_tabs()