mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 19:48:32 +00:00
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>
This commit is contained in:
@@ -125,9 +125,7 @@ endfunction
|
||||
function! s:set_options(pager) abort
|
||||
setlocal noswapfile buftype=nofile bufhidden=hide
|
||||
setlocal nomodified readonly nomodifiable
|
||||
if a:pager
|
||||
nnoremap <silent> <buffer> <nowait> q :lclose<CR>:q<CR>
|
||||
endif
|
||||
let b:pager = a:pager
|
||||
setlocal filetype=man
|
||||
endfunction
|
||||
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user