mirror of
https://github.com/charmbracelet/lipgloss.git
synced 2024-09-11 22:17:12 +03:00
Fix rendering when horizontally joining a block with a height of 2
This commit is contained in:
parent
56a9250443
commit
ae5db7b9f8
9
join.go
9
join.go
@ -92,21 +92,14 @@ func JoinHorizontal(pos float64, strs ...string) string {
|
||||
|
||||
// Merge lines
|
||||
var b strings.Builder
|
||||
var done bool
|
||||
for i := range blocks[0] { // remember, all blocks have the same number of members now
|
||||
for j, block := range blocks {
|
||||
b.WriteString(block[i])
|
||||
|
||||
// Also make lines the same length
|
||||
b.WriteString(strings.Repeat(" ", maxWidths[j]-ansi.PrintableRuneWidth(block[i])))
|
||||
|
||||
if j == len(block)-1 {
|
||||
done = true
|
||||
}
|
||||
}
|
||||
if !done {
|
||||
b.WriteRune('\n')
|
||||
}
|
||||
b.WriteRune('\n')
|
||||
}
|
||||
|
||||
return b.String()
|
||||
|
Loading…
Reference in New Issue
Block a user