From d1633e905a1487e8845088c03db8faf53d587e46 Mon Sep 17 00:00:00 2001 From: ewy Date: Sat, 2 May 2026 19:08:49 +0200 Subject: trim right side space in viewport --- menu/source.go | 6 ++---- menu/state.go | 3 +++ menu/style/debug.go | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 menu/style/debug.go (limited to 'menu') diff --git a/menu/source.go b/menu/source.go index e4026e9..9e0f56a 100644 --- a/menu/source.go +++ b/menu/source.go @@ -18,7 +18,7 @@ var ( st := lipgloss.NewStyle() return st - }) + }).Debug() SourceLabelStyle = style.New(func() lipgloss.Style { st := lipgloss.NewStyle().Border(lipgloss.OuterHalfBlockBorder(), false, false, false, true).Background(SourceHeaderBackground).BorderBackground(SourceHeaderBackground).PaddingRight(1).PaddingLeft(1).MarginRight(1) return st @@ -63,7 +63,5 @@ func (m *Model) Source(src *model.HydratedSource) string { parts = append(parts, Git(src.Git)) } - return SourceStyle.Render(lipgloss.JoinVertical(lipgloss.Top, - parts..., - )) + return SourceStyle.Render(strings.Join(parts, "\n")) } diff --git a/menu/state.go b/menu/state.go index 3a46132..55da10b 100644 --- a/menu/state.go +++ b/menu/state.go @@ -19,9 +19,12 @@ func (m *Model) State() string { sources := make([]string, 0, len(st.Sources)) for i, hs := range st.HydratedSources { src := m.Source(hs) + + // do not pad the bottom source, the motd goes there if i != len(st.HydratedSources)-1 { src += "\n" } + sources = append(sources, src) } diff --git a/menu/style/debug.go b/menu/style/debug.go new file mode 100644 index 0000000..ded4c72 --- /dev/null +++ b/menu/style/debug.go @@ -0,0 +1,9 @@ +package style + +import "github.com/charmbracelet/lipgloss" + +func (s Style) Debug() Style { + return New(func() lipgloss.Style { + return s.builder().Foreground(lipgloss.Color("2")).Background(lipgloss.Color("1")) + }) +} -- cgit v1.3.1