comparison runtime/optwin.vim @ 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 4f7081eb1e26
children 7e6185446ea6
comparison
equal deleted inserted replaced
12038:5399641f85c3 12039:84066f043ab9
1 " These commands create the option window. 1 " These commands create the option window.
2 " 2 "
3 " Maintainer: Bram Moolenaar <Bram@vim.org> 3 " Maintainer: Bram Moolenaar <Bram@vim.org>
4 " Last Change: 2017 Aug 01 4 " Last Change: 2017 Aug 11
5 5
6 " If there already is an option window, jump to that one. 6 " If there already is an option window, jump to that one.
7 if bufwinnr("option-window") > 0 7 let buf = bufnr('option-window')
8 let s:thiswin = winnr() 8 if buf >= 0
9 while 1 9 let winids = win_findbuf(buf)
10 if @% == "option-window" 10 if len(winids) > 0
11 if win_gotoid(winids[0]) == 1
11 finish 12 finish
12 endif 13 endif
13 wincmd w 14 endif
14 if s:thiswin == winnr()
15 break
16 endif
17 endwhile
18 endif 15 endif
19 16
20 " Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would 17 " Make sure the '<' flag is not included in 'cpoptions', otherwise <CR> would
21 " not be recognized. See ":help 'cpoptions'". 18 " not be recognized. See ":help 'cpoptions'".
22 let s:cpo_save = &cpo 19 let s:cpo_save = &cpo
139 if s:thiswin == winnr() 136 if s:thiswin == winnr()
140 break 137 break
141 endif 138 endif
142 endwhile 139 endwhile
143 140
144 " Open the window 141 " Open the window. $OPTWIN_CMD is set to "tab" for ":tab options".
145 new option-window 142 exe $OPTWIN_CMD . ' new option-window'
146 setlocal ts=15 tw=0 noro buftype=nofile 143 setlocal ts=15 tw=0 noro buftype=nofile
147 144
148 " Insert help and a "set" command for each option. 145 " Insert help and a "set" command for each option.
149 call append(0, '" Each "set" line shows the current value of an option (on the left).') 146 call append(0, '" Each "set" line shows the current value of an option (on the left).')
150 call append(1, '" Hit <CR> on a "set" line to execute it.') 147 call append(1, '" Hit <CR> on a "set" line to execute it.')