diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-16 15:29:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-16 15:29:36 +0800 |
commit | da13ed43cb3593f6d50e08fc6e5f26760da63f84 (patch) | |
tree | e210a95266c01861b206479bcda6e3835d2ca4c7 /src/nvim/testdir | |
parent | cf3b871fa940c42e9c94257118f7d1131ebd362a (diff) | |
download | rneovim-da13ed43cb3593f6d50e08fc6e5f26760da63f84.tar.gz rneovim-da13ed43cb3593f6d50e08fc6e5f26760da63f84.tar.bz2 rneovim-da13ed43cb3593f6d50e08fc6e5f26760da63f84.zip |
vim-patch:8.2.3888: the argument list may contain duplicates (#19795)
Problem: The argument list may contain duplicates.
Solution: Add the :argdedeupe command. (Nir Lichtman, closes vim/vim#6235)
https://github.com/vim/vim/commit/73a024209cbfbd5b39a2e974084d807c6131e2ed
Use latest index.txt :argdedupe doc from Vim.
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_arglist.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_arglist.vim b/src/nvim/testdir/test_arglist.vim index 0a72e38755..521c3fcd57 100644 --- a/src/nvim/testdir/test_arglist.vim +++ b/src/nvim/testdir/test_arglist.vim @@ -412,6 +412,35 @@ func Test_argedit() bw! x endfunc +" Test for the :argdedupe command +func Test_argdedupe() + call Reset_arglist() + argdedupe + call assert_equal([], argv()) + args a a a aa b b a b aa + argdedupe + call assert_equal(['a', 'aa', 'b'], argv()) + args a b c + argdedupe + call assert_equal(['a', 'b', 'c'], argv()) + args a + argdedupe + call assert_equal(['a'], argv()) + args a A b B + argdedupe + if has('fname_case') + call assert_equal(['a', 'A', 'b', 'B'], argv()) + else + call assert_equal(['a', 'b'], argv()) + endif + args a b a c a b + last + argdedupe + next + call assert_equal('c', expand('%:t')) + %argd +endfunc + " Test for the :argdelete command func Test_argdelete() call Reset_arglist() |