diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-01-19 01:53:04 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-01-19 02:05:23 +0100 |
commit | 94f4469638590ca5cc724ab6459f2cfc78c621a4 (patch) | |
tree | 01c84f6725dc942d831388d27a8030de157c6846 | |
parent | 20e0cb8d47e42708bea9d828c1d45beeacf9ccae (diff) | |
download | rneovim-94f4469638590ca5cc724ab6459f2cfc78c621a4.tar.gz rneovim-94f4469638590ca5cc724ab6459f2cfc78c621a4.tar.bz2 rneovim-94f4469638590ca5cc724ab6459f2cfc78c621a4.zip |
man.vim: infer $MANPAGER invocation in more cases
This should handle most cases where Nvim was invoked as $MANPAGER.
Ultimately the stakes are low: :quit will prompt if there are unsaved
changes.
fix #7873
-rw-r--r-- | runtime/ftplugin/man.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index e36dfc5a90..68ebb33e45 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -6,7 +6,7 @@ if exists('b:did_ftplugin') || &filetype !=# 'man' endif let b:did_ftplugin = 1 -let s:pager = !exists('b:man_sect') +let s:pager = get(s:, 'pager', 0) || !exists('b:man_sect') if s:pager call man#init_pager() @@ -35,7 +35,7 @@ if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') nnoremap <silent> <buffer> <C-]> :Man<CR> nnoremap <silent> <buffer> K :Man<CR> nnoremap <silent> <buffer> <C-T> :call man#pop_tag()<CR> - if s:pager + if 1 == bufnr('%') || s:pager nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR> else nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c |