--- BaseUtil.pm.original Sun Aug 8 19:50:33 2021 +++ BaseUtil.pm Tue May 10 12:16:22 2022 @@ -157,7 +157,7 @@ my $only_code; $only_code = 1 if !@s; while (1) { my ($s, $s_type) = splice @s, 0, 2; - $s_type //= ''; + $s_type //= $prev_type; last unless $only_code || defined($s); # empty text, only code if ($only_code) { @@ -445,7 +445,7 @@ if ($x + ($line_has_word ? 1:0) + $wordw <= $width) { if ($line_has_word && $ws_before) { - push @res, " "; + splice @res, $#res + $res[-1] !~ /^$re_mult$/, 0, ' '; $x++; } push @res, $word; @@ -474,7 +474,7 @@ push @res, "\n"; $y++; push @res, $crcode; - push @res, $sli; + splice @res, $#res + $sli =~ /\S/, 0, $sli; if ($sliw + $wordw <= $width) { push @res, $word;