diff --git a/tui/bubbles/repo/bubble.go b/tui/bubbles/repo/bubble.go index 573c869dc52ac1f867816ae2c7e85c1b426f2c2b..84a77caa10e79b257bd98a6d13cd98608ae8a7d1 100644 --- a/tui/bubbles/repo/bubble.go +++ b/tui/bubbles/repo/bubble.go @@ -12,11 +12,15 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/glamour" "github.com/charmbracelet/lipgloss" + "github.com/muesli/reflow/truncate" "github.com/muesli/reflow/wordwrap" "github.com/muesli/reflow/wrap" ) -const glamourMaxWidth = 120 +const ( + glamourMaxWidth = 120 + repoNameMaxWidth = 32 +) type ErrMsg struct { Error error @@ -103,7 +107,7 @@ func (b Bubble) headerView() string { ns = ns.Copy().BorderForeground(b.styles.ActiveBorderColor) } var gc string - n := b.name + n := truncate.StringWithTail(b.name, repoNameMaxWidth, "…") if n == "config" { n = "Home" } else {