diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-24 22:06:37 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-24 22:15:42 -0400 |
commit | 13f028e4160ba50a95b0a8aa38599c576a21f928 (patch) | |
tree | 138542403a0ff691c9c7f9019fb2e0accc327730 | |
parent | c0157e8fe0b9b25d9004b3f10a0ef5d33e4ff027 (diff) | |
download | rneovim-13f028e4160ba50a95b0a8aa38599c576a21f928.tar.gz rneovim-13f028e4160ba50a95b0a8aa38599c576a21f928.tar.bz2 rneovim-13f028e4160ba50a95b0a8aa38599c576a21f928.zip |
vim-patch:8.0.0900: :tab options doesn't open a new tab page
Problem: :tab options doesn't open a new tab page. (Aviany)
Solution: Support the :tab modifier. (closes vim/vim#1960)
https://github.com/vim/vim/commit/ab6c8587ba846d08cd70e7b225c4952a468fc1e8
-rw-r--r-- | runtime/optwin.vim | 19 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 1 |
2 files changed, 9 insertions, 11 deletions
diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 81eb3f11fd..83c509b7cb 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -4,17 +4,14 @@ " Last Change: 2017 Oct 19 " If there already is an option window, jump to that one. -if bufwinnr("option-window") > 0 - let s:thiswin = winnr() - while 1 - if @% == "option-window" +let buf = bufnr('option-window') +if buf >= 0 + let winids = win_findbuf(buf) + if len(winids) > 0 + if win_gotoid(winids[0]) == 1 finish endif - wincmd w - if s:thiswin == winnr() - break - endif - endwhile + endif endif " Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would @@ -141,8 +138,8 @@ while exists("b:current_syntax") && b:current_syntax == "help" endif endwhile -" Open the window -new option-window +" Open the window. $OPTWIN_CMD is set to "tab" for ":tab options". +exe $OPTWIN_CMD . ' new option-window' setlocal ts=15 tw=0 noro buftype=nofile " Insert help and a "set" command for each option. diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index c384d253b9..ab24b63110 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2728,6 +2728,7 @@ void ex_packadd(exarg_T *eap) /// ":options" void ex_options(exarg_T *eap) { + vim_setenv("OPTWIN_CMD", cmdmod.tab ? "tab" : ""); cmd_source((char_u *)SYS_OPTWIN_FILE, NULL); } |