diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2015-09-23 04:11:04 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-09-25 22:01:03 -0400 |
commit | af0ca25ba9a87bdaa5e854a09094afc97ff964ef (patch) | |
tree | 201771578d5e6a9a0e2505b4c346c6bed08d6cd7 | |
parent | e073074414f2000c1b4bb291ad3ece33958a427f (diff) | |
download | rneovim-af0ca25ba9a87bdaa5e854a09094afc97ff964ef.tar.gz rneovim-af0ca25ba9a87bdaa5e854a09094afc97ff964ef.tar.bz2 rneovim-af0ca25ba9a87bdaa5e854a09094afc97ff964ef.zip |
man.vim: avoid creating extra blank buffers.
-rw-r--r-- | runtime/autoload/man.vim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index cfd0d35a71..d481d9eaf0 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -48,8 +48,9 @@ function man#get_page(...) abort exec 'let s:man_tag_col_'.s:man_tag_depth.' = '.col('.') let s:man_tag_depth = s:man_tag_depth + 1 - " Use an existing "man" window if it exists, otherwise open a new one. - if !invoked_from_man + let editcmd = 'edit' + " Use an existing 'man' window, else open a new one. + if &filetype !=# 'man' let thiswin = winnr() wincmd b if winnr() > 1 @@ -64,13 +65,13 @@ function man#get_page(...) abort endif endwhile endif - if !invoked_from_man - tabnew - let invoked_from_man = 1 + + if &filetype !=# 'man' + let editcmd = 'tabnew' endif endif - silent exec 'edit man://'.page.(empty(sect)?'':'('.sect.')') + silent exec editcmd.' man://'.page.(empty(sect)?'':'('.sect.')') setlocal modifiable silent keepjumps norm! 1G"_dG @@ -86,7 +87,7 @@ function man#get_page(...) abort setlocal nomodified setlocal filetype=man - if invoked_from_man + if invoked_from_man || editcmd ==# 'tabnew' call s:set_window_local_options() endif endfunction |