From 88454ae86d4578b20826bd2a0ddbde911c99f660 Mon Sep 17 00:00:00 2001 From: Anton Kolchunov Date: Wed, 16 Oct 2024 09:59:18 +0200 Subject: [PATCH] fix: apply wrapping with lipgloss --- ui/components/sidebar/sidebar.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/components/sidebar/sidebar.go b/ui/components/sidebar/sidebar.go index 6fef412a..6c72c015 100644 --- a/ui/components/sidebar/sidebar.go +++ b/ui/components/sidebar/sidebar.go @@ -76,7 +76,9 @@ func (m Model) View() string { func (m *Model) SetContent(data string) { m.data = data - m.viewport.SetContent(data) + + c := lipgloss.NewStyle().Width(m.viewport.Width).Render(data) + m.viewport.SetContent(c) } func (m *Model) GetSidebarContentWidth() int {