fix: chroma portions of glamour renders that could break layout

Christian Rocha created

Change summary

internal/tui/bubbles/repo/bubble.go | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

Detailed changes

internal/tui/bubbles/repo/bubble.go 🔗

@@ -224,16 +224,14 @@ func (b *Bubble) glamourize(md string) (string, error) {
 	if err != nil {
 		return "", err
 	}
-	// For now, truncate long lines in Glamour that would otherwise break the
-	// layout when wrapping. This is very likely due to #43 in Reflow, which
-	// has to do with a bug in the way lines longer than the given width are
-	// wrapped.
+	// For now, hard-wrap long lines in Glamour that would otherwise break the
+	// layout when wrapping. This may be due to #43 in Reflow, which has to do
+	// with a bug in the way lines longer than the given width are wrapped.
 	//
 	//     https://github.com/muesli/reflow/issues/43
 	//
 	// TODO: solve this upstream in Glamour/Reflow.
-	mdt = lipgloss.NewStyle().MaxWidth(w).Render(mdt)
-	return mdt, nil
+	return wrap.String(mdt, w), nil
 }
 
 func max(a, b int) int {