Skip to content

Commit

Permalink
patch 9.0.0346: :horizontal modifier not fully supported
Browse files Browse the repository at this point in the history
Problem:    :horizontal modifier not fully supported.
Solution:   Also use :horizontal for completion and user commands.
            (closes #11025)
  • Loading branch information
zeertzjq authored and brammool committed Sep 1, 2022
1 parent d83392a commit d3de178
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
10 changes: 5 additions & 5 deletions runtime/doc/map.txt
Expand Up @@ -1724,11 +1724,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
Expand Down
1 change: 1 addition & 0 deletions src/cmdexpand.c
Expand Up @@ -1776,6 +1776,7 @@ set_context_by_cmdname(
case CMD_folddoclosed:
case CMD_folddoopen:
case CMD_hide:
case CMD_horizontal:
case CMD_keepalt:
case CMD_keepjumps:
case CMD_keepmarks:
Expand Down
1 change: 1 addition & 0 deletions src/ex_docmd.c
Expand Up @@ -2455,6 +2455,7 @@ do_one_cmd(
case CMD_final:
case CMD_help:
case CMD_hide:
case CMD_horizontal:
case CMD_ijump:
case CMD_ilist:
case CMD_isearch:
Expand Down
4 changes: 4 additions & 0 deletions src/testdir/test_cmdline.vim
Expand Up @@ -1078,6 +1078,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", @:)
Expand Down
4 changes: 4 additions & 0 deletions src/testdir/test_usercommands.vim
Expand Up @@ -103,6 +103,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
Expand Down
3 changes: 3 additions & 0 deletions src/usercmd.c
Expand Up @@ -1443,6 +1443,9 @@ add_win_cmd_modifers(char_u *buf, cmdmod_T *cmod, int *multi_mods)
// :vertical
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;
}

Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -707,6 +707,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
346,
/**/
345,
/**/
Expand Down

0 comments on commit d3de178

Please sign in to comment.