From 089f4f8e4a297aa8e7c689331ffd16ffe415120a Mon Sep 17 00:00:00 2001 From: skippi Date: Sun, 18 Oct 2020 21:36:30 -0500 Subject: vim-patch:8.1.1769: 'shellslash' is also used for completion Problem: 'shellslash' is also used for completion. Solution: Add the 'completeslash' option. (Yasuhiro Matsumoto, closes vim/vim#3612) https://github.com/vim/vim/commit/ac3150d385e6e3f3fe76642aac3cda954d30583f --- src/nvim/testdir/test_ins_complete.vim | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_ins_complete.vim b/src/nvim/testdir/test_ins_complete.vim index b8632b9595..45b0d159d4 100644 --- a/src/nvim/testdir/test_ins_complete.vim +++ b/src/nvim/testdir/test_ins_complete.vim @@ -365,6 +365,52 @@ func Test_compl_in_cmdwin() set wildmenu& wildchar& endfunc +" Test for insert path completion with completeslash option +func Test_ins_completeslash() + if !has('win32') + return + endif + + call mkdir('Xdir') + + let orig_shellslash = &shellslash + set cpt& + + new + + set noshellslash + + set completeslash= + exe "normal oXd\\" + call assert_equal('Xdir\', getline('.')) + + set completeslash=backslash + exe "normal oXd\\" + call assert_equal('Xdir\', getline('.')) + + set completeslash=slash + exe "normal oXd\\" + call assert_equal('Xdir/', getline('.')) + + set shellslash + + set completeslash= + exe "normal oXd\\" + call assert_equal('Xdir/', getline('.')) + + set completeslash=backslash + exe "normal oXd\\" + call assert_equal('Xdir\', getline('.')) + + set completeslash=slash + exe "normal oXd\\" + call assert_equal('Xdir/', getline('.')) + %bw! + call delete('Xdir', 'rf') + + let &shellslash = orig_shellslash +endfunc + func Test_pum_with_folds_two_tabs() CheckScreendump -- cgit From f8fd3d44ac7a89d5573b93a16896abb457e528e0 Mon Sep 17 00:00:00 2001 From: skippi Date: Sun, 25 Oct 2020 18:48:41 -0500 Subject: vim-patch:8.1.1791: 'completeslash' also applies to globpath() Problem: 'completeslash' also applies to globpath(). Solution: Add the WILD_IGNORE_COMPLETESLASH flag. (test by Yasuhiro Matsumoto, closes vim/vim#4760) --- src/nvim/testdir/test_ins_complete.vim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/nvim/testdir') 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() -- cgit From 6a0cb2a948cd7b523a2dc545b165acf6f44d10fb Mon Sep 17 00:00:00 2001 From: skippi Date: Mon, 19 Oct 2020 20:55:27 -0500 Subject: 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 --- src/nvim/testdir/test_ins_complete.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nvim/testdir') 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 -- cgit