Skip to content

Commit e0b5949

Browse files
committed
patch 8.1.1363: ":vert options" does not make a vertical split
Problem: ":vert options" does not make a vertical split. Solution: Pass the right modifiers in $OPTWIN_CMD. (Ken Takata, closes #4401)
1 parent c79745a commit e0b5949

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

src/ex_cmds2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,9 @@ ex_packadd(exarg_T *eap)
30163016
ex_options(
30173017
exarg_T *eap UNUSED)
30183018
{
3019-
vim_setenv((char_u *)"OPTWIN_CMD", (char_u *)(cmdmod.tab ? "tab" : ""));
3019+
vim_setenv((char_u *)"OPTWIN_CMD",
3020+
(char_u *)(cmdmod.tab ? "tab"
3021+
: (cmdmod.split & WSP_VERT) ? "vert" : ""));
30203022
cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
30213023
}
30223024
#endif

src/testdir/test_options.vim

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,32 @@ func Test_options()
5151
endtry
5252
call assert_equal('ok', caught)
5353

54+
" Check if the option-window is opened horizontally.
55+
wincmd j
56+
call assert_notequal('option-window', bufname(''))
57+
wincmd k
58+
call assert_equal('option-window', bufname(''))
59+
" close option-window
60+
close
61+
62+
" Open the option-window vertically.
63+
vert options
64+
" Check if the option-window is opened vertically.
65+
wincmd l
66+
call assert_notequal('option-window', bufname(''))
67+
wincmd h
68+
call assert_equal('option-window', bufname(''))
69+
" close option-window
70+
close
71+
72+
" Open the option-window in a new tab.
73+
tab options
74+
" Check if the option-window is opened in a tab.
75+
normal gT
76+
call assert_notequal('option-window', bufname(''))
77+
normal gt
78+
call assert_equal('option-window', bufname(''))
79+
5480
" close option-window
5581
close
5682
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ static char *(features[]) =
767767

768768
static int included_patches[] =
769769
{ /* Add new patch number below this line */
770+
/**/
771+
1363,
770772
/**/
771773
1362,
772774
/**/

0 commit comments

Comments
 (0)