man.vim: :Man! operates on buffer contents (#9139)

mandoc may not handle quoted MANPAGER arguments correctly. E.g. with
    export MANPAGER='nvim -u NORC -c "set ft=man"'
mandoc treats `"set` and `ft=man"'` as separate tokens.

To workaround that, provide :Man! so that MANPAGER can avoid quoting.

closes #9120
This commit is contained in:
Justin M. Keyes
2018-10-21 17:38:25 +02:00
committed by GitHub
parent b227a3c8d3
commit f895b47d3f
2 changed files with 8 additions and 5 deletions

View File

@@ -5,7 +5,9 @@ if exists('g:loaded_man')
endif
let g:loaded_man = 1
command! -bar -range=0 -complete=customlist,man#complete -nargs=* Man call man#open_page(v:count, v:count1, <q-mods>, <f-args>)
command! -bang -bar -range=0 -complete=customlist,man#complete -nargs=* Man
\ if <bang>0 | set ft=man |
\ else | call man#open_page(v:count, v:count1, <q-mods>, <f-args>) | endif
augroup man
autocmd!