Center lines for asciimoji+text

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2026-05-19 11:04:52 +02:00
parent 0cfba17d3d
commit b5e2721aa1
10 changed files with 41 additions and 16 deletions
+1 -1
View File
@@ -307,7 +307,7 @@ func (m *Model) refreshBody() {
}
if raw == "" {
w, h := m.bodyViewport.Width(), m.bodyViewport.Height()
m.bodyViewport.SetContent(lipgloss.Place(w, h, lipgloss.Center, lipgloss.Center, style.S.Faint.Render(" (˘・_・˘)\nno response stored")))
m.bodyViewport.SetContent(lipgloss.Place(w, h, lipgloss.Center, lipgloss.Center, style.S.Faint.Render(util.CenterLines("(˘・_・˘)", "no response stored"))))
return
}
m.bodyViewport.SetContent(style.HighlightHTTP(raw))
+3 -2
View File
@@ -9,6 +9,7 @@ import (
"github.com/anotherhadi/spilltea/internal/icons"
"github.com/anotherhadi/spilltea/internal/keys"
"github.com/anotherhadi/spilltea/internal/style"
"github.com/anotherhadi/spilltea/internal/util"
)
func (m Model) View() tea.View {
@@ -84,9 +85,9 @@ func (m *Model) renderList() string {
)
}
if len(m.entries) == 0 {
msg := " (⌐■_■)\nno history yet"
msg := util.CenterLines("(⌐■_■)", "no history yet")
if m.searchKind != searchKindOff {
msg = "ʕノ•ᴥ•ʔノ ︵ ┻━┻\n no results"
msg = util.CenterLines("ʕノ•ᴥ•ʔノ ︵ ┻━┻", "no results")
}
return lipgloss.Place(
m.listViewport.Width(), m.listViewport.Height(),