Skip to content

Commit f041b97

Browse files
Add ability to specify character in pad function (#141)
1 parent 1d2535d commit f041b97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Themes/Default/Concerns/DrawsBoxes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ protected function longest(array $lines, int $padding = 0): int
7474
/**
7575
* Pad text ignoring ANSI escape sequences.
7676
*/
77-
protected function pad(string $text, int $length): string
77+
protected function pad(string $text, int $length, string $char = ' '): string
7878
{
79-
$rightPadding = str_repeat(' ', max(0, $length - mb_strwidth($this->stripEscapeSequences($text))));
79+
$rightPadding = str_repeat($char, max(0, $length - mb_strwidth($this->stripEscapeSequences($text))));
8080

8181
return "{$text}{$rightPadding}";
8282
}

0 commit comments

Comments
 (0)