diff options
author | Filip Gospodinov <f@gospodinov.ch> | 2023-08-09 18:00:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 18:00:36 +0200 |
commit | 64dea84bb05a29117cf2708085021c535b898975 (patch) | |
tree | 17ec17c179db1860e69430e7ee1562f75acb22b2 /runtime/plugin | |
parent | bd76c89e31ac9d9efd00ec8dda9c32436415dbbb (diff) |
Manpager: apply g flag conditionally to s command (#12679)
Problem: The `s` command with `g` flag only substitutes
one occurrence when `gdefault` is set.
Solution: Use `g` flag conditionally.
Diffstat (limited to 'runtime/plugin')
-rw-r--r-- | runtime/plugin/manpager.vim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/plugin/manpager.vim b/runtime/plugin/manpager.vim index 1738dc9439..076aca5f83 100644 --- a/runtime/plugin/manpager.vim +++ b/runtime/plugin/manpager.vim @@ -30,10 +30,10 @@ function s:ManPager() setlocal modifiable " Emulate 'col -b' - silent! keepj keepp %s/\v(.)\b\ze\1?//ge + exe 'silent! keepj keepp %s/\v(.)\b\ze\1?//e' .. (&gdefault ? '' : 'g') " Remove ansi sequences - silent! keepj keepp %s/\v\e\[%(%(\d;)?\d{1,2})?[mK]//ge + exe 'silent! keepj keepp %s/\v\e\[%(%(\d;)?\d{1,2})?[mK]//e' .. (&gdefault ? '' : 'g') " Remove empty lines above the header call cursor(1, 1) |