add footer note to TUI (#8867)

This will be used by the elevated sandbox NUX to give a hint on how to
run the elevated sandbox when in the non-elevated mode.
This commit is contained in:
iceweasel-oai
2026-01-07 16:44:28 -08:00
committed by GitHub
parent ef8b8ebc94
commit 357e4c902b
6 changed files with 226 additions and 26 deletions

View File

@@ -26,6 +26,17 @@ pub(crate) struct GenericDisplayRow {
pub wrap_indent: Option<usize>, // optional indent for wrapped lines
}
pub(crate) fn wrap_styled_line<'a>(line: &'a Line<'a>, width: u16) -> Vec<Line<'a>> {
use crate::wrapping::RtOptions;
use crate::wrapping::word_wrap_line;
let width = width.max(1) as usize;
let opts = RtOptions::new(width)
.initial_indent(Line::from(""))
.subsequent_indent(Line::from(""));
word_wrap_line(line, opts)
}
fn line_width(line: &Line<'_>) -> usize {
line.iter()
.map(|span| UnicodeWidthStr::width(span.content.as_ref()))