diff options
author | skippi <jbtcao@gmail.com> | 2020-10-19 20:55:27 -0500 |
---|---|---|
committer | skippi <jbtcao@gmail.com> | 2020-10-26 15:22:23 -0500 |
commit | 6a0cb2a948cd7b523a2dc545b165acf6f44d10fb (patch) | |
tree | 87aafbbea8cc03bc9250f2710f1dd2e1971af01f | |
parent | f8fd3d44ac7a89d5573b93a16896abb457e528e0 (diff) | |
download | rneovim-6a0cb2a948cd7b523a2dc545b165acf6f44d10fb.tar.gz rneovim-6a0cb2a948cd7b523a2dc545b165acf6f44d10fb.tar.bz2 rneovim-6a0cb2a948cd7b523a2dc545b165acf6f44d10fb.zip |
vim-patch:8.2.1747: result of expand() unexpectedly depends on 'completeslash'
Problem: Result of expand() unexpectedly depends on 'completeslash'.
Solution: Temporarily reset 'completeslash'. (Yasuhiro Matsumoto,
closes vim/vim#7021)
https://github.com/vim/vim/commit/8f187fc6304222956f94a700758a490cc8c0af99
-rw-r--r-- | src/nvim/eval/funcs.c | 9 | ||||
-rw-r--r-- | src/nvim/testdir/test_ins_complete.vim | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index e5912efb13..83ef9c8762 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2071,6 +2071,12 @@ static void f_expand(typval_T *argvars, typval_T *rettv, FunPtr fptr) expand_T xpc; bool error = false; char_u *result; +#ifdef BACKSLASH_IN_FILENAME + char_u *p_csl_save = p_csl; + + // avoid using 'completeslash' here + p_csl = empty_option; +#endif rettv->v_type = VAR_STRING; if (argvars[1].v_type != VAR_UNKNOWN @@ -2123,6 +2129,9 @@ static void f_expand(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_string = NULL; } } +#ifdef BACKSLASH_IN_FILENAME + p_csl = p_csl_save; +#endif } diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index be79b33f9c..57a0a7aaf4 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -414,6 +414,19 @@ func Test_ins_completeslash() set completeslash= endfunc +func Test_issue_7021() + CheckMSWindows + + let orig_shellslash = &shellslash + set noshellslash + + set completeslash=slash + call assert_false(expand('~') =~ '/') + + let &shellslash = orig_shellslash + set completeslash= +endfunc + func Test_pum_with_folds_two_tabs() CheckScreendump |