]> granicus.if.org Git - vim/commitdiff
patch 8.0.0900: :tab options doesn't open a new tab page v8.0.0900
authorBram Moolenaar <Bram@vim.org>
Fri, 11 Aug 2017 15:15:09 +0000 (17:15 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 11 Aug 2017 15:15:09 +0000 (17:15 +0200)
Problem:    :tab options doesn't open a new tab page. (Aviany)
Solution:   Support the :tab modifier. (closes #1960)

runtime/optwin.vim
src/ex_cmds2.c
src/version.c

index 1a9fa3abdcfae118cc2d042c023229156bbcd33e..52f987e8849467c01195ae3ea08c8f6fb4a4a548 100644 (file)
@@ -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: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.
index 26b588c650a5cc210dc4787f12c1b0a16c54d84c..8a11fbbe9f7e06c8568b2fd7b060d931fc110ab1 100644 (file)
@@ -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
index 707be4fa30e6a720f0059708a6caed929f1cd79a..9e3764e6c7dce9f03a5ef73c79003f7098cebe47 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    900,
 /**/
     899,
 /**/