From 01e6503672f48893383dbe48f67268045b901450 Mon Sep 17 00:00:00 2001
From: Jeremy Rose <172423086+nornagon-openai@users.noreply.github.com>
Date: Tue, 30 Sep 2025 16:13:55 -0700
Subject: [PATCH] wrap markdown at render time (#4506)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This results in correctly indenting list items with long lines.
---
codex-rs/tui/src/chatwidget.rs | 14 +-
codex-rs/tui/src/chatwidget/tests.rs | 1 +
codex-rs/tui/src/history_cell.rs | 70 +++---
codex-rs/tui/src/markdown.rs | 56 ++++-
codex-rs/tui/src/markdown_render.rs | 269 +++++++++++++++++++----
codex-rs/tui/src/markdown_stream.rs | 28 +--
codex-rs/tui/src/streaming/controller.rs | 8 +-
codex-rs/tui/src/streaming/mod.rs | 4 +-
8 files changed, 347 insertions(+), 103 deletions(-)
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs
index 981e0dfa9..da363d5da 100644
--- a/codex-rs/tui/src/chatwidget.rs
+++ b/codex-rs/tui/src/chatwidget.rs
@@ -256,6 +256,8 @@ pub(crate) struct ChatWidget {
ghost_snapshots_disabled: bool,
// Whether to add a final message separator after the last message
needs_final_message_separator: bool,
+
+ last_rendered_width: std::cell::Cell