aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-08-26 15:17:54 +0200
committerGitHub <noreply@github.com>2018-08-26 15:17:54 +0200
commit8f058dca890ca9b9678e2435020f84a5f9c75acb (patch)
tree1e52a92192a46d3f660ce02b7891b365f2da0d7f /runtime
parent7898de5211fc396dc5a001a22f9c7db5311c317e (diff)
parente85bed083022c88bd8c42d91f8432eb5dd4ff141 (diff)
downloadrneovim-8f058dca890ca9b9678e2435020f84a5f9c75acb.tar.gz
rneovim-8f058dca890ca9b9678e2435020f84a5f9c75acb.tar.bz2
rneovim-8f058dca890ca9b9678e2435020f84a5f9c75acb.zip
Merge #8904 from janlazo/vim-8.0.0900
Diffstat (limited to 'runtime')
-rw-r--r--runtime/optwin.vim19
1 files changed, 8 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.