]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0473: term_start() does not clear vertical modifier v9.1.0473
authorYegappan Lakshmanan <yegappan@yahoo.com>
Mon, 10 Jun 2024 16:16:34 +0000 (18:16 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 10 Jun 2024 16:16:34 +0000 (18:16 +0200)
Problem:  term_start() does not clear vertical modifier
Solution: Clear the flag after splitting the window
          (Yegappan Lakshmanan)

closes: #14953

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/terminal.c
src/testdir/test_terminal3.vim
src/version.c

index 25a6a5dd7618a016a8113b2fcbe429a4aec18edc..28e1abfec3f01a24d5e7a0a753b86828095fce61 100644 (file)
@@ -538,9 +538,15 @@ term_start(
            split_ea.addr_count = 1;
        }
 
+       int cmod_split_modified = FALSE;
        if (vertical)
+       {
            cmdmod.cmod_split |= WSP_VERT;
+           cmod_split_modified = TRUE;
+       }
        ex_splitview(&split_ea);
+       if (vertical && cmod_split_modified)
+           cmdmod.cmod_split &= ~WSP_VERT;
        if (curwin == old_curwin)
        {
            // split failed
index 848e3fa4735376a234be0da4e475c6150c4dd5bf..3cca1b05cb8117d24f1db996a7d7ce1b8db0fc2c 100644 (file)
@@ -10,6 +10,8 @@ source screendump.vim
 source mouse.vim
 source term_util.vim
 
+import './vim9.vim' as v9
+
 let $PROMPT_COMMAND=''
 
 func Test_terminal_altscreen()
@@ -959,4 +961,18 @@ func Test_terminal_vt420()
   call StopVimInTerminal(buf)
 endfunc
 
+" Test for using 'vertical' with term_start(). If a following term_start(),
+" doesn't have the 'vertical' attribute, then it should be split horizontally.
+func Test_terminal_vertical()
+  let lines =<< trim END
+    call term_start("NONE", {'vertical': 1})
+    call term_start("NONE")
+    VAR layout = winlayout()
+    call assert_equal('row', layout[0], string(layout))
+    call assert_equal('col', layout[1][0][0], string(layout))
+    :%bw!
+  END
+  call v9.CheckLegacyAndVim9Success(lines)
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index 334ebd716c248481a6e55e0d780405c4107a4ec7..78668eaad4186ff92760088004026e39494fda4b 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    473,
 /**/
     472,
 /**/