@@ -534,28 +534,14 @@ func (m *TUIModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
534534 if msg .text != "" && msg .text != m .lastAgentMessage {
535535 m .lastAgentMessage = msg .text
536536 m .addLog ("spacing" , "" , "" )
537- // Format agent messages with proper markdown spacing
538- // Wrap text at 120 chars max for readability
539537 maxWidth := min (max (m .width - 8 , 40 ), 120 )
540- lines := strings .Split (msg .text , "\n " )
541- for i , line := range lines {
542- trimmed := strings .TrimSpace (line )
543- switch {
544- case trimmed == "" :
545- // Keep blank lines for markdown formatting
538+ rendered := renderAgentMessage (msg .text , maxWidth )
539+ for _ , line := range strings .Split (rendered , "\n " ) {
540+ if strings .TrimSpace (line ) == "" {
546541 m .addLog ("spacing" , "" , "" )
547- case strings .HasPrefix (trimmed , "#" ):
548- if i > 0 {
549- m .addLog ("spacing" , "" , "" )
550- }
551- m .addLog ("agent-header" , trimmed , "" )
552- default :
553- // Wrap long lines for readability
554- wrapped := wrapText (trimmed , maxWidth )
555- for _ , wrappedLine := range strings .Split (wrapped , "\n " ) {
556- m .addLog ("agent" , wrappedLine , "" )
557- }
542+ continue
558543 }
544+ m .addLog ("agent" , line , "" )
559545 }
560546 }
561547 }
0 commit comments