diff --git a/ui/components/views-tabs/viewstabs.go b/ui/components/views-tabs/viewstabs.go index 48d8a38..d5b1426 100644 --- a/ui/components/views-tabs/viewstabs.go +++ b/ui/components/views-tabs/viewstabs.go @@ -121,7 +121,10 @@ func (m Model) View() string { BorderRight(m.ifBorders). BorderTop(m.ifBorders). BorderLeft(m.ifBorders). - // MaxWidth(m.size.Width). + // Height(1). + // Height(1 + borderMaring). + MaxHeight(1 + borderMaring). + MaxWidth(m.size.Width). Width(m.size.Width - borderMaring) s := strings.Builder{} @@ -143,16 +146,19 @@ func (m Model) View() string { } else { t = inactiveTabStyle.Render(tabContent) } - s.WriteString(" " + t + " ") - if i != len(m.tabs)-1 { - s.WriteString("|") - } + content := " " + t + " " - if s.Len()+len(moreTabsIcon) > m.ctx.WindowSize.Width { + if lipgloss.Width(s.String()+content+moreTabsIcon) >= m.size.Width-borderMaring { s.WriteString(moreTabsIcon) break } + s.WriteString(content) + + if i != len(m.tabs)-1 { + s.WriteString("|") + } + } return style.Render(s.String())