Compare commits

...

2 Commits

Author SHA1 Message Date
easong-openai
63f0e1fa43 Merge branch 'main' into nornagon/wrap-user-message 2025-08-05 22:45:16 -07:00
Jeremy Rose
318c78ca3c wrap user message 2025-08-04 15:58:16 -07:00

View File

@@ -28,6 +28,7 @@ use std::collections::HashMap;
use std::io::Cursor;
use std::path::PathBuf;
use std::time::Duration;
use textwrap::Options;
use tracing::error;
pub(crate) struct CommandOutput {
@@ -246,7 +247,15 @@ impl HistoryCell {
pub(crate) fn new_user_prompt(message: String) -> Self {
let mut lines: Vec<Line<'static>> = Vec::new();
lines.push(Line::from("user".cyan().bold()));
lines.extend(message.lines().map(|l| Line::from(l.to_string())));
let width = 80;
lines.extend(
textwrap::wrap(
&message,
Options::new(width).wrap_algorithm(textwrap::WrapAlgorithm::FirstFit),
)
.iter()
.map(|l| Line::from(l.to_string())),
);
lines.push(Line::from(""));
HistoryCell::UserPrompt {