mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
## What changed - Use Ratatui-compatible terminal widths throughout TUI layout, preserving full-width counters for long lines. - Wrap and truncate on grapheme boundaries so halfwidth kana sound marks and emoji sequences stay intact. - Apply the corrected sizing to text input, selection popups, status and history cells, Markdown, hyperlinks, and scrollable cloud diffs. ## Testing - Add focused unit and snapshot coverage for wrapping, truncation, cursor and mask alignment, popup columns, status output, session headers, Markdown tables, process output, and scrollable diffs. GitOrigin-RevId: 294ec0bcff743c6bb16d55ec26308524ce741879
20 lines
496 B
Rust
20 lines
496 B
Rust
use super::line_width;
|
|
use super::truncate_line_to_width;
|
|
use pretty_assertions::assert_eq;
|
|
use ratatui::text::Line;
|
|
|
|
#[test]
|
|
fn halfwidth_sound_marks_stay_with_their_grapheme_when_truncated() {
|
|
let line = Line::from("abガc");
|
|
|
|
assert_eq!(line_width(&line), 5);
|
|
assert_eq!(
|
|
truncate_line_to_width(line.clone(), /*max_width*/ 3),
|
|
Line::from("ab")
|
|
);
|
|
assert_eq!(
|
|
truncate_line_to_width(line, /*max_width*/ 4),
|
|
Line::from("abガ")
|
|
);
|
|
}
|