Skip to content

Commit

Permalink
Fix adding right padding to empty string
Browse files Browse the repository at this point in the history
An empty string could not have padding applied on the right side.

Issue: charmbracelet#252
Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
  • Loading branch information
mikelorant committed Jan 26, 2024
1 parent fb3000d commit 79fdbeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion style.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func padLeft(str string, n int, style *termenv.Style) string {

// Apply right padding.
func padRight(str string, n int, style *termenv.Style) string {
if n == 0 || str == "" {
if n == 0 {
return str
}

Expand Down

0 comments on commit 79fdbeb

Please sign in to comment.