diff options
author | Karl Williamson <khw@cpan.org> | 2020-11-30 20:55:30 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-11-30 21:12:15 -0700 |
commit | c1ec4bdd803f587dd2ae76548bca0ae59d0fe84b (patch) | |
tree | c4e44fd1a4e94036818dafaa12e7835bbd6f12c5 /regen | |
parent | add0fa588474394597ad4b9734b2d1646a7b225e (diff) | |
download | perl-c1ec4bdd803f587dd2ae76548bca0ae59d0fe84b.tar.gz |
Account for 'less' reserving an extra column
After decades of stability, the 'less' pager project decided to claim an
extra column for its own use when called with certain common options.
This commit changes some of the auto-generating tools to wrap one column
earlier to compensate, and changes podcheck to also whine on wide
verbatim text one column less. But it changes the podcheck data base
to grandfather-in all the many existing places that exceed that amount.
That means only changes made to pods after this commit will be held to
the stricter value.
Of course, what this means is those pods will wrap or truncate in these
places on an 80 column window, making them harder to read, when used
with 'less' and when it is called with the options that reserve those
two columns. Patches welcome.
I haven't seen the wrapping problem with perldoc, and haven't
investigated much.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/regcomp.pl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/regen/regcomp.pl b/regen/regcomp.pl index 34e7ec8e39..4994a8bcf1 100644 --- a/regen/regcomp.pl +++ b/regen/regcomp.pl @@ -397,9 +397,10 @@ sub print_state_def_line my $hanging = length $line; # Indent any subsequent line to this pos $line .= sprintf "0x%02x", $id; - my $columns = 79; + my $columns = 78; - # wrap() needs 80 to achieve 79. + # From the documentation: 'In fact, every resulting line will have length + # of no more than "$columns - 1"' $line = wrap($columns + 1, "", " " x $hanging, "$line $comment"); chomp $line; # wrap always adds a trailing \n $line =~ s/ \s+ $ //x; # trim, just in case. |