From 684e2dfa71e249194ad54288dcbc33a12c145396 Mon Sep 17 00:00:00 2001 From: Len Woodward Date: Sun, 14 Apr 2024 00:59:40 -0700 Subject: [PATCH] Add ability to specify character in pad function --- src/Themes/Default/Concerns/DrawsBoxes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Themes/Default/Concerns/DrawsBoxes.php b/src/Themes/Default/Concerns/DrawsBoxes.php index 2b4567ac..6eb5a0ce 100644 --- a/src/Themes/Default/Concerns/DrawsBoxes.php +++ b/src/Themes/Default/Concerns/DrawsBoxes.php @@ -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}"; }