0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 9.1.0473: term_start() does not clear vertical modifier

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>
This commit is contained in:
Yegappan Lakshmanan
2024-06-10 18:16:34 +02:00
committed by Christian Brabandt
parent dfc21db0b0
commit d603e95609
3 changed files with 24 additions and 0 deletions

View File

@@ -538,9 +538,15 @@ term_start(
split_ea.addr_count = 1; split_ea.addr_count = 1;
} }
int cmod_split_modified = FALSE;
if (vertical) if (vertical)
{
cmdmod.cmod_split |= WSP_VERT; cmdmod.cmod_split |= WSP_VERT;
cmod_split_modified = TRUE;
}
ex_splitview(&split_ea); ex_splitview(&split_ea);
if (vertical && cmod_split_modified)
cmdmod.cmod_split &= ~WSP_VERT;
if (curwin == old_curwin) if (curwin == old_curwin)
{ {
// split failed // split failed

View File

@@ -10,6 +10,8 @@ source screendump.vim
source mouse.vim source mouse.vim
source term_util.vim source term_util.vim
import './vim9.vim' as v9
let $PROMPT_COMMAND='' let $PROMPT_COMMAND=''
func Test_terminal_altscreen() func Test_terminal_altscreen()
@@ -959,4 +961,18 @@ func Test_terminal_vt420()
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
endfunc 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 " vim: shiftwidth=2 sts=2 expandtab

View File

@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
473,
/**/ /**/
472, 472,
/**/ /**/