diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2021-12-25 06:56:33 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2021-12-25 07:42:06 +0800 |
| commit | 8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266 (patch) | |
| tree | f7622e277f4acf39ec8bc061cf983001ffc26176 /src/nvim/testdir/test_cmdline.vim | |
| parent | 0d7a97224f28cdf47d7ecc80b6d300c8c67c0b29 (diff) | |
| download | rneovim-8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266.tar.gz rneovim-8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266.tar.bz2 rneovim-8eff0ca6d50bf2ef0897a08f5fdbc0abed7c1266.zip | |
vim-patch:8.2.2468: not easy to get the full command name from a shortened one
Problem: Not easy to get the full command name from a shortened one.
Solution: Add fullcommand(). (Martin Tournoij, closes vim/vim#7777)
https://github.com/vim/vim/commit/038e09ee7645731de0296d255aabb17603276443
Diffstat (limited to 'src/nvim/testdir/test_cmdline.vim')
| -rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 49a5386337..1672b0e840 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -467,6 +467,43 @@ func Test_getcompletion() call assert_fails('call getcompletion("abc", [])', 'E475:') endfunc +func Test_fullcommand() + let tests = { + \ '': '', + \ ':': '', + \ ':::': '', + \ ':::5': '', + \ 'not_a_cmd': '', + \ 'Check': '', + \ 'syntax': 'syntax', + \ ':syntax': 'syntax', + \ '::::syntax': 'syntax', + \ 'sy': 'syntax', + \ 'syn': 'syntax', + \ 'synt': 'syntax', + \ ':sy': 'syntax', + \ '::::sy': 'syntax', + \ 'match': 'match', + \ '2match': 'match', + \ '3match': 'match', + \ 'aboveleft': 'aboveleft', + \ 'abo': 'aboveleft', + \ 's': 'substitute', + \ '5s': 'substitute', + \ ':5s': 'substitute', + \ "'<,'>s": 'substitute', + \ ":'<,'>s": 'substitute', + \ 'CheckUni': 'CheckUnix', + \ 'CheckUnix': 'CheckUnix', + \ } + + for [in, want] in items(tests) + call assert_equal(want, fullcommand(in)) + endfor + + call assert_equal('syntax', 'syn'->fullcommand()) +endfunc + func Test_shellcmd_completion() let save_path = $PATH |