mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00:00 
			
		
		
		
	feat(man.vim): "q" always closes window #30819
This commit is contained in:
		@@ -269,6 +269,10 @@ These existing features changed their behavior.
 | 
			
		||||
• |vim.on_key()| callbacks won't be invoked recursively when a callback itself
 | 
			
		||||
  consumes input.
 | 
			
		||||
 | 
			
		||||
• "q" in man pages now uses |CTRL-W_q| instead of |CTRL-W_c| to close the
 | 
			
		||||
  current window, and it no longer throws |E444| when there is only one window
 | 
			
		||||
  on the screen. Global variable `vim.g.pager` is removed.
 | 
			
		||||
 | 
			
		||||
==============================================================================
 | 
			
		||||
REMOVED FEATURES                                                 *news-removed*
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,11 +26,7 @@ if !exists('g:no_plugin_maps') && !exists('g:no_man_maps')
 | 
			
		||||
  nnoremap <silent> <buffer> k             gk
 | 
			
		||||
  nnoremap <silent> <buffer> gO            :lua require'man'.show_toc()<CR>
 | 
			
		||||
  nnoremap <silent> <buffer> <2-LeftMouse> :Man<CR>
 | 
			
		||||
  if get(g:, 'pager')
 | 
			
		||||
    nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q
 | 
			
		||||
  else
 | 
			
		||||
    nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c
 | 
			
		||||
  endif
 | 
			
		||||
  nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>q
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
if get(g:, 'ft_man_folding_enable', 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -675,7 +675,6 @@ function M.init_pager()
 | 
			
		||||
    vim.cmd.file({ 'man://' .. fn.fnameescape(ref):lower(), mods = { silent = true } })
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  vim.g.pager = true
 | 
			
		||||
  set_options()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user