From 6bb3e9e23fe57ce796beba662dd795fb16da047c Mon Sep 17 00:00:00 2001 From: patriceckhart Date: Sat, 18 Apr 2026 10:23:02 +0200 Subject: [PATCH] fix code formatting --- internal/tui/view.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/tui/view.go b/internal/tui/view.go index fb02455..117c617 100644 --- a/internal/tui/view.go +++ b/internal/tui/view.go @@ -82,8 +82,15 @@ func (v *View) Build(width int) []string { } if v.StreamingActive { out = append(out, v.Theme.FG256(v.Theme.Assistant, "▍ zot")) - for _, line := range wrapLine(v.Streaming, width, "") { - out = append(out, line) + // Stream the partial assistant text through the same markdown + // renderer used for finalised messages so code fences, diffs, + // lists, and inline styles look the same while streaming and + // don't suddenly reflow when the turn ends. + md := RenderMarkdown(v.Streaming, v.Theme, width) + for _, l := range strings.Split(md, "\n") { + for _, w := range wrapLine(l, width, "") { + out = append(out, w) + } } out = append(out, "") }