Closes: #12301
https://github.com/vim/vim/pull/12557
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Depending on Col's provenance, tabs may be substituted for
runs of spaces, with or without its -h or -x flags.
The emulation comment should admit that there is no such
translation before or after :substitute.
Compare output:
{ man col | col -bx; } > /tmp/col.1.x
{ man col | col -bh; } > /tmp/col.1.h
{ man col | col -b; } > /tmp/col.1
diff -q /tmp/col.1.h /tmp/col.1
vimdiff -o /tmp/col.1.x /tmp/col.1—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
The emulation comment should admit that there is no such translation before or after
:substitute.
I think referring to the issue is sufficient. There are other details left out of the comment that are equally relevant. Brevity requires that a number of details be omitted, which is why the link to the issue was added.
Personally, I would much rather remove any attempt to reformat the output of man at all since man makes use of col to reformat its text when output is not a terminal. All of this seems redundant now.
If man does the same thing on MacOS, I think we can get rid of it.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Merging #12557 (7fc6fd3) into master (bc385a1) will decrease coverage by
5.02%.
The diff coverage isn/a.
@@ Coverage Diff @@ ## master #12557 +/- ## ========================================== - Coverage 82.09% 77.07% -5.02% ========================================== Files 160 150 -10 Lines 193650 151269 -42381 Branches 43481 38978 -4503 ========================================== - Hits 158978 116592 -42386 - Misses 21826 22511 +685 + Partials 12846 12166 -680
| Flag | Coverage Δ | |
|---|---|---|
| huge-clang-none | ? |
|
| linux | ? |
|
| mingw-x64-HUGE | ? |
|
| mingw-x86-HUGE | 77.07% <ø> (-0.01%) |
⬇️ |
| windows | 77.07% <ø> (-1.13%) |
⬇️ |
Flags with carried forward coverage won't be shown. Click here to find out more.
see 154 files with indirect coverage changes
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
should be okay to include. One question however:
@lifecrisis @goweol are you both co-maintaining the plugin?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Merged #12557 into master.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Hi, this change seems to have broken this plugin on Mac. This is the before:
Now it looks like this (only when you invoke :Man ls from Vim, not when you are using it as a MANPAGER):
I haven't taken a closer look yet but can we revert the change while someone works on a fix?
Additionally, can we add some unit tests to prevent regressions in the future in the supported platforms? I think right now the bundled plugins are mostly untested which have from time to time result in regressions like this and basic regression tests on the main platforms would help catch the issues before they get merged.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Actually, I found the issue. It's because I have set gdefault in my vimrc, and the substitute command uses the g flag, which gets inverted under this. Which to be fair, even if we have regression tests, this may not have been tested as it's an edge case.
I think we can fix it like so (I will open PR):
diff --git a/runtime/autoload/dist/man.vim b/runtime/autoload/dist/man.vim index 315636a2ef..e517714f58 100644 --- a/runtime/autoload/dist/man.vim +++ b/runtime/autoload/dist/man.vim @@ -196,7 +196,11 @@ 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 + if &gdefault + silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//e + else + silent! keepjumps keeppatterns %s/\v(.)\b\ze\1?//ge + endif if unsetwidth let $MANWIDTH = ''
The docs for gdefault does say that it's deprecated because of this reason, but I find it a little unsatisfactory:
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
'gdefault' 'gd' boolean (default off)
global
...
DEPRECATED: Setting this option may break plugins that are not aware
of this option. Also, many users get confused that adding the /g flag
has the opposite effect of that it normally does.
This option is not used in |Vim9| script.
Feels to me we should just expose a way to do substitution that can ignore gdefault instead (like how ignorecase is ignored if \c or \C is used).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()