]> granicus.if.org Git - vim/commitdiff
patch 9.0.0346: :horizontal modifier not fully supported v9.0.0346
authorzeertzjq <zeertzjq@outlook.com>
Thu, 1 Sep 2022 11:58:52 +0000 (12:58 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 1 Sep 2022 11:58:52 +0000 (12:58 +0100)
Problem:    :horizontal modifier not fully supported.
Solution:   Also use :horizontal for completion and user commands.
            (closes #11025)

runtime/doc/map.txt
src/cmdexpand.c
src/ex_docmd.c
src/testdir/test_cmdline.vim
src/testdir/test_usercommands.vim
src/usercmd.c
src/version.c

index 69557d61468a4ee336a79ae857d62eaf9d85a3ac..6beae6ee2cc49db8aae53bab502fbc50dfeafffa 100644 (file)
@@ -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
index 5cdb1beab5a5a4effe100cc50c656dde0c990b6d..bfa30533bc70f5e64f868046034291e999a4e40c 100644 (file)
@@ -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:
index 681ab2ca2b63d175e8f39cf31f173b4dbab24d53..9f7875f5eb904a9430cc97b7e74353e4460c00fd 100644 (file)
@@ -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:
index 95db663bdfddcd1ac477e9dec29339cabf2092bc..bec0f5fdf8f1cb62c890783cb9669737ea6a4078 100644 (file)
@@ -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", @:)
index 9c75a91972432e9b531a218d7061cb4f393a5d6f..91d8bfd0621650b9ff5e993dcb9982c0b642112a 100644 (file)
@@ -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
index 71135119e8fa781b897526d70892c31dbb84d166..6b3eadc9340336b1976e896c317379ae9d0f7274 100644 (file)
@@ -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;
 }
 
index 0e463479856d9e07e7a578461924afd06a103225..f6cdb1c5be4f654a4b838d00dfe6e19ea8fe1049 100644 (file)
@@ -707,6 +707,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    346,
 /**/
     345,
 /**/