diff options
author | xudyang1 <61672396+xudyang1@users.noreply.github.com> | 2024-10-15 11:34:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-15 08:34:50 -0700 |
commit | ea5b748f243883b9890e465d4abef598fe2b07fc (patch) | |
tree | da7679fce4a0aa26638d1dc4f5a6fadf1af0e0d9 | |
parent | 84623dbe93777c0a8e7ddf57470ddeb2ea738069 (diff) | |
download | rneovim-ea5b748f243883b9890e465d4abef598fe2b07fc.tar.gz rneovim-ea5b748f243883b9890e465d4abef598fe2b07fc.tar.bz2 rneovim-ea5b748f243883b9890e465d4abef598fe2b07fc.zip |
feat(man.vim): "q" always closes window #30819
-rw-r--r-- | runtime/doc/news.txt | 4 | ||||
-rw-r--r-- | runtime/ftplugin/man.vim | 6 | ||||
-rw-r--r-- | runtime/lua/man.lua | 1 |
3 files changed, 5 insertions, 6 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 5c93128f25..4db9188f90 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -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* diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index 37667477f3..5ea36c32ce 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -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) diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index fce8f89be8..6f60bf1cef 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -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 |