summaryrefslogtreecommitdiffstats
path: root/runtime/autoload
diff options
context:
space:
mode:
authorlifecrisis <jrf@elitemail.org>2023-08-20 18:41:25 +0000
committerGitHub <noreply@github.com>2023-08-20 20:41:25 +0200
commit17befac581ea67f56039db832d68963cd401fb8a (patch)
tree16d7eec42152a8392e4c2833e1d689e348d58273 /runtime/autoload
parentca22fc36a4e8a315f199893ee8ff6253573f5fbe (diff)
runtime(man): remove backslashes in man pages using Vim script (#12557)
Closes: vim/vim#12301 Co-authored-by: Jason Franklin <jason@oneway.dev>
Diffstat (limited to 'runtime/autoload')
-rw-r--r--runtime/autoload/dist/man.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/autoload/dist/man.vim b/runtime/autoload/dist/man.vim
index 5b8b4456db..315636a2ef 100644
--- a/runtime/autoload/dist/man.vim
+++ b/runtime/autoload/dist/man.vim
@@ -1,6 +1,6 @@
" Vim filetype plugin autoload file
" Language: man
-" Maintainer: Jason Franklin <vim@justemail.net>
+" Maintainer: Jason Franklin <jason@oneway.dev>
" Maintainer: SungHyun Nam <goweol@gmail.com>
" Autoload Split: Bram Moolenaar
" Last Change: 2023 Jun 28
@@ -190,9 +190,14 @@ func dist#man#GetPage(cmdmods, ...)
endif
let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat'
let env_cmd .= ' GROFF_NO_SGR=1'
- let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b'
+ let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page)
+
silent exec "r !" . man_cmd
+ " Emulate piping the buffer through the "col -b" command.
+ " Ref: https://github.com/vim/vim/issues/12301
+ silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//ge
+
if unsetwidth
let $MANWIDTH = ''
endif