Subject: | Indentation of text is being ignored |
Hello HÃ¥kon!
I ran into the problem that text with indentation will result in the removal of the preceding spaces. In the project I use the indentation is very important. The bug was found in the Wrap.pm module. Hereby I supply a patch for that module.
Best,
Janno Schouwenburg
Subject: | PatchIndent.diff |
--- /Library/Perl/5.18/Text/ASCIITable/Wrap.pm 2017-11-25 21:50:24.000000000 +0100
+++ Wrap.pm 2017-11-25 21:52:46.000000000 +0100
@@ -48,8 +48,9 @@
my @result;
my $line='';
$nostrict = defined($nostrict) && $nostrict == 1 ? 1 : 0;
- for (split(/ /,$text)) {
- my $spc = $line eq '' ? 0 : 1;
+ my $index=0;
+ for (split(/ /,$text)) {
+ my $spc = $index++ == 0 ? 0 : 1;
my $len = length($line);
my $newlen = $len + $spc + length($_);
if ($len == 0 && $newlen > $width) {