1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 14:26:46 +00:00

There is no blank line at the end of status

This commit is contained in:
Tw93
2025-12-12 10:49:57 +08:00
parent cb81570a73
commit f858d43b88
4 changed files with 69 additions and 58 deletions

View File

@@ -98,7 +98,10 @@ func (m model) View() string {
if m.width <= 80 {
var rendered []string
for _, c := range cards {
for i, c := range cards {
if i > 0 {
rendered = append(rendered, "")
}
rendered = append(rendered, renderCard(c, cardWidth, 0))
}
return header + "\n" + lipgloss.JoinVertical(lipgloss.Left, rendered...)

View File

@@ -585,7 +585,7 @@ func renderCard(data cardData, width int, height int) string {
lineLen = 4
}
header := titleStyle.Render(titleText) + " " + lineStyle.Render(strings.Repeat("─", lineLen))
content := header + "\n" + strings.Join(data.lines, "\n") + "\n"
content := header + "\n" + strings.Join(data.lines, "\n")
// Pad to target height
lines := strings.Split(content, "\n")
@@ -765,7 +765,16 @@ func renderTwoColumns(cards []cardData, width int) string {
rows = append(rows, left)
}
}
return lipgloss.JoinVertical(lipgloss.Left, rows...)
// Add empty lines between rows for separation
var spacedRows []string
for i, r := range rows {
if i > 0 {
spacedRows = append(spacedRows, "")
}
spacedRows = append(spacedRows, r)
}
return lipgloss.JoinVertical(lipgloss.Left, spacedRows...)
}
func maxInt(a, b int) int {