]> granicus.if.org Git - vim/commitdiff
patch 8.1.1363: ":vert options" does not make a vertical split v8.1.1363
authorBram Moolenaar <Bram@vim.org>
Tue, 21 May 2019 18:54:45 +0000 (20:54 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 21 May 2019 18:54:45 +0000 (20:54 +0200)
Problem:    ":vert options" does not make a vertical split.
Solution:   Pass the right modifiers in $OPTWIN_CMD. (Ken Takata,
            closes #4401)

src/ex_cmds2.c
src/testdir/test_options.vim
src/version.c

index 18c438ce0cb66bbd20a8021cafba4bbe0e1dec60..bf6e5512090fd5c21847789841b2ae6f2c5b07da 100644 (file)
@@ -3016,7 +3016,9 @@ ex_packadd(exarg_T *eap)
 ex_options(
     exarg_T    *eap UNUSED)
 {
-    vim_setenv((char_u *)"OPTWIN_CMD", (char_u *)(cmdmod.tab ? "tab" : ""));
+    vim_setenv((char_u *)"OPTWIN_CMD",
+           (char_u *)(cmdmod.tab ? "tab"
+               : (cmdmod.split & WSP_VERT) ? "vert" : ""));
     cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
 }
 #endif
index c5dbb9f4c47b7b6081a295d64950ca7359b01eb4..13de719342338ad79cc3d414de4be3fae9789cf3 100644 (file)
@@ -51,6 +51,32 @@ func Test_options()
   endtry
   call assert_equal('ok', caught)
 
+  " Check if the option-window is opened horizontally.
+  wincmd j
+  call assert_notequal('option-window', bufname(''))
+  wincmd k
+  call assert_equal('option-window', bufname(''))
+  " close option-window
+  close
+
+  " Open the option-window vertically.
+  vert options
+  " Check if the option-window is opened vertically.
+  wincmd l
+  call assert_notequal('option-window', bufname(''))
+  wincmd h
+  call assert_equal('option-window', bufname(''))
+  " close option-window
+  close
+
+  " Open the option-window in a new tab.
+  tab options
+  " Check if the option-window is opened in a tab.
+  normal gT
+  call assert_notequal('option-window', bufname(''))
+  normal gt
+  call assert_equal('option-window', bufname(''))
+
   " close option-window
   close
 endfunc
index cdcd132e434575a3f4656404acabcccc9bab6d2d..fb7dad390ed7638957ab8ee8a9f1ccddf7df77ee 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1363,
 /**/
     1362,
 /**/