aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-05-22 05:09:25 -0400
committerJustin M. Keyes <justinkz@gmail.com>2019-05-22 11:09:25 +0200
commit55fa966a929ddf62fa06df63cbdfed63fbc499eb (patch)
treeaba7e3e091452ace3e71bc580ab9eb5eebdd5085
parent62d5137c8348e80d6231d8c7cc3784c70361030c (diff)
downloadrneovim-55fa966a929ddf62fa06df63cbdfed63fbc499eb.tar.gz
rneovim-55fa966a929ddf62fa06df63cbdfed63fbc499eb.tar.bz2
rneovim-55fa966a929ddf62fa06df63cbdfed63fbc499eb.zip
vim-patch:8.1.1363: ":vert options" #10048
Problem: ":vert options" does not make a vertical split. Solution: Pass the right modifiers in $OPTWIN_CMD. (Ken Takata, closes vim/vim#4401) https://github.com/vim/vim/commit/e0b5949a3b28be9940bb8a46b2579e960100b83b
-rw-r--r--src/nvim/ex_cmds2.c3
-rw-r--r--src/nvim/testdir/test_options.vim26
2 files changed, 29 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 40ff29d4a8..a2ed37e37e 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -2826,6 +2826,9 @@ void ex_packadd(exarg_T *eap)
void ex_options(exarg_T *eap)
{
vim_setenv("OPTWIN_CMD", cmdmod.tab ? "tab" : "");
+ vim_setenv("OPTWIN_CMD",
+ cmdmod.tab ? "tab" :
+ (cmdmod.split & WSP_VERT) ? "vert" : "");
cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
}
diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim
index 7b640ee2ff..78afa929d0 100644
--- a/src/nvim/testdir/test_options.vim
+++ b/src/nvim/testdir/test_options.vim
@@ -51,6 +51,32 @@ function! 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
endfunction