Skip to content

Commit

Permalink
fix(tree): stylize whitespace when vertically joining tree elements
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Aug 2, 2024
1 parent fcfc436 commit 269ae9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tree/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ func (r *renderer) render(node Node, root bool, prefix string) string {
// the current node's prefix have the same height.
for lipgloss.Height(item) > lipgloss.Height(nodePrefix) {
nodePrefix = lipgloss.JoinVertical(
lipgloss.Top,
lipgloss.Left,
nodePrefix,
enumStyle.Render(indent),
)
}
for lipgloss.Height(nodePrefix) > lipgloss.Height(multineLinePrefix) {
multineLinePrefix = lipgloss.JoinVertical(
lipgloss.Top,
lipgloss.Left,
multineLinePrefix,
prefix,
)
Expand All @@ -98,7 +98,7 @@ func (r *renderer) render(node Node, root bool, prefix string) string {
strs = append(
strs,
lipgloss.JoinHorizontal(
lipgloss.Left,
lipgloss.Top,
multineLinePrefix,
nodePrefix,
item,
Expand Down Expand Up @@ -126,7 +126,7 @@ func (r *renderer) render(node Node, root bool, prefix string) string {
}
}
}
return lipgloss.JoinVertical(lipgloss.Top, strs...)
return strings.Join(strs, "\n")
}

func max(a, b int) int {
Expand Down

0 comments on commit 269ae9f

Please sign in to comment.