From e89eb5d21bf4323bb690bc54d1f035bfd5d6b1e6 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 6 Aug 2016 05:52:36 -0400 Subject: man.vim: refactoring and autocmd fix - man#open_page_command and man#open_page_mapping are now a single function - New autocmd to fix #5172 --- runtime/plugin/man.vim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim index 82ef154725..b5b118fbe3 100644 --- a/runtime/plugin/man.vim +++ b/runtime/plugin/man.vim @@ -5,6 +5,15 @@ if exists('g:loaded_man') endif let g:loaded_man = 1 -command! -count=0 -complete=customlist,man#complete -nargs=* Man call man#open_page_command(v:count, v:count1, ) +command! -count=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, ) -nnoremap (Man) :call man#open_page_mapping(v:count, v:count1, &filetype ==# 'man' ? expand('') : expand('')) +nnoremap (Man) :call man#open_page(v:count, v:count1, &filetype ==# 'man' ? expand('') : expand('')) + +augroup man + autocmd! + autocmd BufReadCmd man://* call man#read_page(matchstr(expand(''), 'man://\zs.*')) + " Need this because without it, if you do ':Man printf(3)' and then later, + " open a session that contains a buffer named 'man://printf(3)', the buffer + " will become listed. + autocmd BufEnter man://* set nobuflisted +augroup END -- cgit