Skip to content

Commit

Permalink
Add ability to specify character in pad function (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjektGopher authored Apr 29, 2024
1 parent 1d2535d commit f041b97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Themes/Default/Concerns/DrawsBoxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ protected function longest(array $lines, int $padding = 0): int
/**
* Pad text ignoring ANSI escape sequences.
*/
protected function pad(string $text, int $length): string
protected function pad(string $text, int $length, string $char = ' '): string
{
$rightPadding = str_repeat(' ', max(0, $length - mb_strwidth($this->stripEscapeSequences($text))));
$rightPadding = str_repeat($char, max(0, $length - mb_strwidth($this->stripEscapeSequences($text))));

return "{$text}{$rightPadding}";
}
Expand Down

0 comments on commit f041b97

Please sign in to comment.