Skip to content

Commit

Permalink
Add ability to specify character in pad function
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjektGopher committed Apr 26, 2024
1 parent 4a1c974 commit 1c3b6f8
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, $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 1c3b6f8

Please sign in to comment.