diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-09-01 20:25:34 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-09-01 20:28:23 +0800 |
commit | 56bf026deac8eddb1abc8e1d46fde992cfc67ac2 (patch) | |
tree | 032c507086ecf662d70faaaead827bc274561d80 | |
parent | c65b1f3e15662cd14c443e34862237d3dee30977 (diff) | |
download | rneovim-56bf026deac8eddb1abc8e1d46fde992cfc67ac2.tar.gz rneovim-56bf026deac8eddb1abc8e1d46fde992cfc67ac2.tar.bz2 rneovim-56bf026deac8eddb1abc8e1d46fde992cfc67ac2.zip |
vim-patch:9.0.0346: :horizontal modifier not fully supported
Problem: :horizontal modifier not fully supported.
Solution: Also use :horizontal for completion and user commands.
(closes vim/vim#11025)
https://github.com/vim/vim/commit/d3de178e5352fedf0f30b979f46a2fcbca24ea40
-rw-r--r-- | runtime/doc/map.txt | 10 | ||||
-rw-r--r-- | src/nvim/cmdexpand.c | 1 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_usercommands.vim | 4 | ||||
-rw-r--r-- | src/nvim/usercmd.c | 4 |
6 files changed, 19 insertions, 5 deletions
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index ca1ddaabd4..da6a305e89 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1623,11 +1623,11 @@ The valid escape sequences are *<mods>* *<q-mods>* *:command-modifiers* <mods> The command modifiers, if specified. Otherwise, expands to nothing. Supported modifiers are |:aboveleft|, |:belowright|, - |:botright|, |:browse|, |:confirm|, |:hide|, |:keepalt|, - |:keepjumps|, |:keepmarks|, |:keeppatterns|, |:leftabove|, - |:lockmarks|, |:noautocmd|, |:noswapfile| |:rightbelow|, - |:sandbox|, |:silent|, |:tab|, |:topleft|, |:unsilent|, - |:verbose|, and |:vertical|. + |:botright|, |:browse|, |:confirm|, |:hide|, |:horizontal|, + |:keepalt|, |:keepjumps|, |:keepmarks|, |:keeppatterns|, + |:leftabove|, |:lockmarks|, |:noautocmd|, |:noswapfile| + |:rightbelow|, |:sandbox|, |:silent|, |:tab|, |:topleft|, + |:unsilent|, |:verbose|, and |:vertical|. Note that |:filter| is not supported. Examples: > command! -nargs=+ -complete=file MyEdit diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c index 6fc63f72a1..9d8dd197bd 100644 --- a/src/nvim/cmdexpand.c +++ b/src/nvim/cmdexpand.c @@ -1203,6 +1203,7 @@ static const char *set_context_by_cmdname(const char *cmd, cmdidx_T cmdidx, cons case CMD_folddoclosed: case CMD_folddoopen: case CMD_hide: + case CMD_horizontal: case CMD_keepalt: case CMD_keepjumps: case CMD_keepmarks: diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index f99253ea75..ea21dc8ae7 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1757,6 +1757,7 @@ static bool skip_cmd(const exarg_T *eap) case CMD_filter: case CMD_help: case CMD_hide: + case CMD_horizontal: case CMD_ijump: case CMD_ilist: case CMD_isearch: diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 4bfd22cb6c..bc06e70ff4 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -926,6 +926,10 @@ func Test_cmdline_complete_various() call feedkeys(":all abc\<C-A>\<C-B>\"\<CR>", 'xt') call assert_equal("\"all abc\<C-A>", @:) + " completion for :wincmd with :horizontal modifier + call feedkeys(":horizontal wincm\<C-A>\<C-B>\"\<CR>", 'xt') + call assert_equal("\"horizontal wincmd", @:) + " completion for a command with a command modifier call feedkeys(":topleft new\<C-A>\<C-B>\"\<CR>", 'xt') call assert_equal("\"topleft new", @:) diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim index e37fe43b22..1065dd16e2 100644 --- a/src/nvim/testdir/test_usercommands.vim +++ b/src/nvim/testdir/test_usercommands.vim @@ -101,6 +101,10 @@ function Test_cmdmods() call assert_equal('vertical', g:mods) vert MyCmd call assert_equal('vertical', g:mods) + horizontal MyCmd + call assert_equal('horizontal', g:mods) + hor MyCmd + call assert_equal('horizontal', g:mods) aboveleft belowright botright browse confirm hide keepalt keepjumps \ keepmarks keeppatterns lockmarks noautocmd noswapfile silent diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c index 9cc9fb5588..3726273d28 100644 --- a/src/nvim/usercmd.c +++ b/src/nvim/usercmd.c @@ -1247,6 +1247,10 @@ size_t add_win_cmd_modifers(char *buf, const cmdmod_T *cmod, bool *multi_mods) if (cmod->cmod_split & WSP_VERT) { result += add_cmd_modifier(buf, "vertical", multi_mods); } + // :horizontal + if (cmod->cmod_split & WSP_HOR) { + result += add_cmd_modifier(buf, "horizontal", multi_mods); + } return result; } |