aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/man.vim
diff options
context:
space:
mode:
authorArsham Shirvani <arshamshirvani@gmail.com>2022-05-13 15:49:08 +0100
committerGitHub <noreply@github.com>2022-05-13 07:49:08 -0700
commitf6ba7d69be2c57f80c9ee95276733e949aceb009 (patch)
treee01e8ad790bb33b42e31064d5aa660b5a311380c /runtime/ftplugin/man.vim
parenteb4b337d9eb8bf15cf0b832f46ea9cff14d6adce (diff)
downloadrneovim-f6ba7d69be2c57f80c9ee95276733e949aceb009.tar.gz
rneovim-f6ba7d69be2c57f80c9ee95276733e949aceb009.tar.bz2
rneovim-f6ba7d69be2c57f80c9ee95276733e949aceb009.zip
fix(man.vim): q in "$MANPAGER mode" does not quit #18443
Problem: q in "$MANPAGER mode" does not quit Nvim. This is because ftplugin/man.vim creates its own mapping: nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c which overrides the one set by the autoload file when using :Man! ("$MANPAGER mode") Solution: Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the mapping correctly. Fixes #18281 Ref #17791 Helped-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Diffstat (limited to 'runtime/ftplugin/man.vim')
-rw-r--r--runtime/ftplugin/man.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index fce12012b5..d7a08a9941 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -24,7 +24,11 @@ if !exists('g:no_plugin_maps') && !exists('g:no_man_maps')
nnoremap <silent> <buffer> k gk
nnoremap <silent> <buffer> gO :call man#show_toc()<CR>
nnoremap <silent> <buffer> <2-LeftMouse> :Man<CR>
- nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
+ if get(b:, 'pager')
+ nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q
+ else
+ nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
+ endif
endif
if get(g:, 'ft_man_folding_enable', 0)