summaryrefslogtreecommitdiff
path: root/autodoc.pl
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-11-06 07:12:28 -0700
committerKarl Williamson <khw@cpan.org>2020-11-06 07:24:38 -0700
commitca7113073cac53c5ac744b2699c0dffc7c4e26df (patch)
tree00e6e5b7a5d987c60a477fafed744c844dfbb7dc /autodoc.pl
parentf29b3ac763630c43a7efbb437cc71a9cb1beac85 (diff)
downloadperl-ca7113073cac53c5ac744b2699c0dffc7c4e26df.tar.gz
Revert and fix "autodoc.pl: Don't recalculate value"
This reverts commit 0213d97dcda976f02ce257031d969e7964ecc545, and fixes it up. That commit failed to account for that there were extra components needed in the calculation
Diffstat (limited to 'autodoc.pl')
-rw-r--r--autodoc.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/autodoc.pl b/autodoc.pl
index 31f98bd9af..d52438926f 100644
--- a/autodoc.pl
+++ b/autodoc.pl
@@ -1268,6 +1268,9 @@ sub docout ($$$) { # output the docs for one function
my $name_indent = $indent + $longest_ret;
$name_indent += $ret_name_sep_length if $longest_ret;
+ my $this_max_width =
+ $max_width - $description_indent - $usage_indent;
+
for my $item (@items) {
my $ret_type = $item->{ret_type};
my @args = $item->{args}->@*;
@@ -1321,7 +1324,7 @@ sub docout ($$$) { # output the docs for one function
# short2,
# very_long_argument,
# short3)
- if ($total_length > $max_width) {
+ if ($total_length > $this_max_width) {
# If this is the first continuation line,
# calculate the longest argument; this will be the
@@ -1350,9 +1353,10 @@ sub docout ($$$) { # output the docs for one function
}
# Calculate the new indent if necessary.
- $arg_indent = $max_width - $longest_arg_length
+ $arg_indent =
+ $this_max_width - $longest_arg_length
if $arg_indent + $longest_arg_length
- > $max_width;
+ > $this_max_width;
}
print $fh "\n", (" " x $arg_indent);