Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Skip postprocessing for short composer input (#39744)

Benjamin Carlssonc3db1804933d
diff --git a/codex-rs/tui/src/bottom_pane/textarea/wrapping.rs b/codex-rs/tui/src/bottom_pane/textarea/wrapping.rs
index e125f8d68b..1250ba71bf 100644
--- a/codex-rs/tui/src/bottom_pane/textarea/wrapping.rs
+++ b/codex-rs/tui/src/bottom_pane/textarea/wrapping.rs
@@ -56,7 +56,7 @@ pub(super) fn wrapped_lines(text: &str, width: u16) -> Vec<Range<usize>> {
let width = usize::from(width);
let options = Options::new(width).wrap_algorithm(textwrap::WrapAlgorithm::FirstFit);
let wrapped_lines = crate::wrapping::wrap_ranges(text, &options);
- if width == 0 {
+ if width == 0 || (wrapped_lines.len() == 1 && text.len() < width) {
return wrapped_lines;
}