From 1aefecc7272da7090a03ea20913289fdb407feca Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Sat, 30 Mar 2024 12:54:11 +0000 Subject: [PATCH] feat: better formatting for titles --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 381dab4..ec56933 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" + "strings" "github.com/charmbracelet/bubbles/help" "github.com/charmbracelet/bubbles/key" @@ -15,6 +16,7 @@ import ( var ( checkMark = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).SetString("✓") docStyle = lipgloss.NewStyle().Margin(1, 2) + titleStyle = lipgloss.NewStyle().Bold(true) ) type keyMap struct { @@ -67,7 +69,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } func (m model) View() string { - s := "Pinging hosts...\n\n" + s := titleStyle.Render("Pinging hosts...") + strings.Repeat("\n", 2) for _, address := range m.addresses { _, err := probing.NewPinger(fmt.Sprintf("%s", address)) if err != nil {