summaryrefslogtreecommitdiffstats
path: root/runtime/optwin.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-08-11 17:15:09 +0200
committerBram Moolenaar <Bram@vim.org>2017-08-11 17:15:09 +0200
commitab6c8587ba846d08cd70e7b225c4952a468fc1e8 (patch)
tree50816eab3c395774fb4523fca0855d00f625f3f4 /runtime/optwin.vim
parent2d33e90f81334eee34275a259444434abf56250f (diff)
patch 8.0.0900: :tab options doesn't open a new tab pagev8.0.0900
Problem: :tab options doesn't open a new tab page. (Aviany) Solution: Support the :tab modifier. (closes #1960)
Diffstat (limited to 'runtime/optwin.vim')
-rw-r--r--runtime/optwin.vim21
1 files changed, 9 insertions, 12 deletions
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 1a9fa3abdc..52f987e884 100644
--- 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: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.