runtime(man): Man plugin does not respect 'gdefault'

Commit: 
https://github.com/vim/vim/commit/249a2088036fb77948f208050b9f7790bf3c11a8
Author: Yee Cheng Chin <[email protected]>
Date:   Sat Sep 16 18:09:47 2023 +0200

    runtime(man): Man plugin does not respect 'gdefault'
    
    Fix the issue introduced by https://github.com/vim/vim/issues/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 <[email protected]>

diff --git a/runtime/autoload/dist/man.vim b/runtime/autoload/dist/man.vim
index 315636a2e..7f7d13711 100644
--- a/runtime/autoload/dist/man.vim
+++ b/runtime/autoload/dist/man.vim
@@ -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/ (.) \ze ?//ge
+  exe 'silent! keepjumps keeppatterns %s/ (.) \ze ?//e' .. (&gdefault ? '' : 
'g')
 
   if unsetwidth
     let $MANWIDTH = ''

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1qhXwq-00FBLx-UE%40256bit.org.

Raspunde prin e-mail lui