mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-20 05:19:24 +02:00
fix padding with coloures strings
This commit is contained in:
parent
4a4dc676fc
commit
53cded77f1
@ -33,10 +33,11 @@ func SplitLines(multilineString string) []string {
|
||||
|
||||
// WithPadding pads a string as much as you want
|
||||
func WithPadding(str string, padding int) string {
|
||||
if padding-len(str) < 0 {
|
||||
uncoloredStr := Decolorise(str)
|
||||
if padding < len(uncoloredStr) {
|
||||
return str
|
||||
}
|
||||
return str + strings.Repeat(" ", padding-len(str))
|
||||
return str + strings.Repeat(" ", padding-len(uncoloredStr))
|
||||
}
|
||||
|
||||
// ColoredString takes a string and a colour attribute and returns a colored
|
||||
|
Loading…
x
Reference in New Issue
Block a user