Mercurial > vim
diff src/testdir/test_ins_complete.vim @ 17543:77c3f6428b6c v8.1.1769
patch 8.1.1769: 'shellslash' is also used for completion
commit https://github.com/vim/vim/commit/ac3150d385e6e3f3fe76642aac3cda954d30583f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 28 16:36:39 2019 +0200
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 https://github.com/vim/vim/issues/3612)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 28 Jul 2019 16:45:05 +0200 |
parents | fa6c9047ec70 |
children | 76f2afc8cd93 |
line wrap: on
line diff
--- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -331,3 +331,50 @@ func Test_compl_in_cmdwin() delcom GetInput 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\<C-X>\<C-F>" + call assert_equal('Xdir\', getline('.')) + + set completeslash=backslash + exe "normal oXd\<C-X>\<C-F>" + call assert_equal('Xdir\', getline('.')) + + set completeslash=slash + exe "normal oXd\<C-X>\<C-F>" + call assert_equal('Xdir/', getline('.')) + + set shellslash + + set completeslash= + exe "normal oXd\<C-X>\<C-F>" + call assert_equal('Xdir/', getline('.')) + + set completeslash=backslash + exe "normal oXd\<C-X>\<C-F>" + call assert_equal('Xdir\', getline('.')) + + set completeslash=slash + exe "normal oXd\<C-X>\<C-F>" + call assert_equal('Xdir/', getline('.')) + %bw! + call delete('Xdir', 'rf') + + let &shellslash = orig_shellslash +endfunc +