changeset 12039:84066f043ab9 v8.0.0900

patch 8.0.0900: :tab options doesn't open a new tab page commit https://github.com/vim/vim/commit/ab6c8587ba846d08cd70e7b225c4952a468fc1e8 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 11 17:15:09 2017 +0200 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 https://github.com/vim/vim/issues/1960)
author Christian Brabandt <cb@256bit.org>
date Fri, 11 Aug 2017 17:30:04 +0200
parents 5399641f85c3
children 60e650490220
files runtime/optwin.vim src/ex_cmds2.c src/version.c
diffstat 3 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,20 +1,17 @@
 " These commands create the option window.
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2017 Aug 01
+" Last Change:	2017 Aug 11
 
 " 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:cu
   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.
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -3749,6 +3749,7 @@ ex_packadd(exarg_T *eap)
 ex_options(
     exarg_T	*eap UNUSED)
 {
+    vim_setenv((char_u *)"OPTWIN_CMD", (char_u *)(cmdmod.tab ? "tab" : ""));
     cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
 }
 #endif
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    900,
+/**/
     899,
 /**/
     898,