]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(man): Man plugin does not respect 'gdefault'
authorYee Cheng Chin <ychin.git@gmail.com>
Sat, 16 Sep 2023 16:09:47 +0000 (18:09 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 16 Sep 2023 16:12:14 +0000 (18:12 +0200)
Fix the issue introduced by #12557. `:substitute` commands in plugins
need to take into account whether `gdefault` is set or not because
that depends on the user.

closes: #13097

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/dist/man.vim

index 315636a2efed17e04bc390b1f80e3020a5f57cee..7f7d137113a774da44646c590cd953268cf91eaa 100644 (file)
@@ -196,7 +196,7 @@ func dist#man#GetPage(cmdmods, ...)
 
   " 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
+  exe 'silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//e' .. (&gdefault ? '' : 'g')
 
   if unsetwidth
     let $MANWIDTH = ''