comparison src/testdir/test_usercommands.vim @ 20043:d13f8ae3b1de v8.2.0577

patch 8.2.0577: not all modifiers supported for :options Commit: https://github.com/vim/vim/commit/7a1637f4c00ac3d0cbf894803ada1586a1717470 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 13 21:16:21 2020 +0200 patch 8.2.0577: not all modifiers supported for :options Problem: Not all modifiers supported for :options. Solution: Use all cmdmod.split flags. (closes https://github.com/vim/vim/issues/4401)
author Bram Moolenaar <Bram@vim.org>
date Mon, 13 Apr 2020 21:30:36 +0200
parents b3e93a05c3ca
children 0b35a7ffceb2
comparison
equal deleted inserted replaced
20042:7573d650a983 20043:d13f8ae3b1de
2 2
3 " Test for <mods> in user defined commands 3 " Test for <mods> in user defined commands
4 function Test_cmdmods() 4 function Test_cmdmods()
5 let g:mods = '' 5 let g:mods = ''
6 6
7 command! -nargs=* MyCmd let g:mods .= '<mods> ' 7 command! -nargs=* MyCmd let g:mods = '<mods>'
8 8
9 MyCmd 9 MyCmd
10 call assert_equal('', g:mods)
10 aboveleft MyCmd 11 aboveleft MyCmd
12 call assert_equal('aboveleft', g:mods)
11 abo MyCmd 13 abo MyCmd
14 call assert_equal('aboveleft', g:mods)
12 belowright MyCmd 15 belowright MyCmd
16 call assert_equal('belowright', g:mods)
13 bel MyCmd 17 bel MyCmd
18 call assert_equal('belowright', g:mods)
14 botright MyCmd 19 botright MyCmd
20 call assert_equal('botright', g:mods)
15 bo MyCmd 21 bo MyCmd
22 call assert_equal('botright', g:mods)
16 browse MyCmd 23 browse MyCmd
24 call assert_equal('browse', g:mods)
17 bro MyCmd 25 bro MyCmd
26 call assert_equal('browse', g:mods)
18 confirm MyCmd 27 confirm MyCmd
28 call assert_equal('confirm', g:mods)
19 conf MyCmd 29 conf MyCmd
30 call assert_equal('confirm', g:mods)
20 hide MyCmd 31 hide MyCmd
32 call assert_equal('hide', g:mods)
21 hid MyCmd 33 hid MyCmd
34 call assert_equal('hide', g:mods)
22 keepalt MyCmd 35 keepalt MyCmd
36 call assert_equal('keepalt', g:mods)
23 keepa MyCmd 37 keepa MyCmd
38 call assert_equal('keepalt', g:mods)
24 keepjumps MyCmd 39 keepjumps MyCmd
40 call assert_equal('keepjumps', g:mods)
25 keepj MyCmd 41 keepj MyCmd
42 call assert_equal('keepjumps', g:mods)
26 keepmarks MyCmd 43 keepmarks MyCmd
44 call assert_equal('keepmarks', g:mods)
27 kee MyCmd 45 kee MyCmd
46 call assert_equal('keepmarks', g:mods)
28 keeppatterns MyCmd 47 keeppatterns MyCmd
48 call assert_equal('keeppatterns', g:mods)
29 keepp MyCmd 49 keepp MyCmd
50 call assert_equal('keeppatterns', g:mods)
30 leftabove MyCmd " results in :aboveleft 51 leftabove MyCmd " results in :aboveleft
52 call assert_equal('aboveleft', g:mods)
31 lefta MyCmd 53 lefta MyCmd
54 call assert_equal('aboveleft', g:mods)
32 lockmarks MyCmd 55 lockmarks MyCmd
56 call assert_equal('lockmarks', g:mods)
33 loc MyCmd 57 loc MyCmd
58 call assert_equal('lockmarks', g:mods)
34 " noautocmd MyCmd 59 " noautocmd MyCmd
35 noswapfile MyCmd 60 noswapfile MyCmd
61 call assert_equal('noswapfile', g:mods)
36 nos MyCmd 62 nos MyCmd
63 call assert_equal('noswapfile', g:mods)
37 rightbelow MyCmd " results in :belowright 64 rightbelow MyCmd " results in :belowright
65 call assert_equal('belowright', g:mods)
38 rightb MyCmd 66 rightb MyCmd
67 call assert_equal('belowright', g:mods)
39 " sandbox MyCmd 68 " sandbox MyCmd
40 silent MyCmd 69 silent MyCmd
70 call assert_equal('silent', g:mods)
41 sil MyCmd 71 sil MyCmd
72 call assert_equal('silent', g:mods)
42 tab MyCmd 73 tab MyCmd
74 call assert_equal('tab', g:mods)
43 topleft MyCmd 75 topleft MyCmd
76 call assert_equal('topleft', g:mods)
44 to MyCmd 77 to MyCmd
78 call assert_equal('topleft', g:mods)
45 " unsilent MyCmd 79 " unsilent MyCmd
46 verbose MyCmd 80 verbose MyCmd
81 call assert_equal('verbose', g:mods)
47 verb MyCmd 82 verb MyCmd
83 call assert_equal('verbose', g:mods)
48 vertical MyCmd 84 vertical MyCmd
85 call assert_equal('vertical', g:mods)
49 vert MyCmd 86 vert MyCmd
87 call assert_equal('vertical', g:mods)
50 88
51 aboveleft belowright botright browse confirm hide keepalt keepjumps 89 aboveleft belowright botright browse confirm hide keepalt keepjumps
52 \ keepmarks keeppatterns lockmarks noswapfile silent tab 90 \ keepmarks keeppatterns lockmarks noswapfile silent tab
53 \ topleft verbose vertical MyCmd 91 \ topleft verbose vertical MyCmd
54 92
55 call assert_equal(' aboveleft aboveleft belowright belowright botright ' . 93 call assert_equal('browse confirm hide keepalt keepjumps ' .
56 \ 'botright browse browse confirm confirm hide hide ' . 94 \ 'keepmarks keeppatterns lockmarks noswapfile silent ' .
57 \ 'keepalt keepalt keepjumps keepjumps keepmarks keepmarks ' . 95 \ 'verbose aboveleft belowright botright tab topleft vertical', g:mods)
58 \ 'keeppatterns keeppatterns aboveleft aboveleft lockmarks lockmarks noswapfile ' .
59 \ 'noswapfile belowright belowright silent silent tab topleft topleft verbose verbose ' .
60 \ 'vertical vertical ' .
61 \ 'aboveleft belowright botright browse confirm hide keepalt keepjumps ' .
62 \ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' .
63 \ 'verbose vertical ', g:mods)
64 96
65 let g:mods = '' 97 let g:mods = ''
66 command! -nargs=* MyQCmd let g:mods .= '<q-mods> ' 98 command! -nargs=* MyQCmd let g:mods .= '<q-mods> '
67 99
68 vertical MyQCmd 100 vertical MyQCmd