Blank lines in table cells of selected message should be highlighted (#23)

This commit is contained in:
Ulyssa 2023-01-25 17:03:28 -08:00
parent afe892c7fe
commit 5683a2e7a8
No known key found for this signature in database
GPG key ID: 1B3965A3D18B9B64
2 changed files with 3 additions and 3 deletions

View file

@ -198,7 +198,7 @@ impl Table {
}) })
.collect(); .collect();
let joined = join_cell_text(cells, Span::styled(line::VERTICAL, style)); let joined = join_cell_text(cells, Span::styled(line::VERTICAL, style), style);
text.lines.extend(joined.lines); text.lines.extend(joined.lines);
nrows += 1; nrows += 1;

View file

@ -125,7 +125,7 @@ pub fn space_text(width: usize, style: Style) -> Text<'static> {
space_span(width, style).into() space_span(width, style).into()
} }
pub fn join_cell_text<'a>(texts: Vec<(Text<'a>, usize)>, join: Span<'a>) -> Text<'a> { pub fn join_cell_text<'a>(texts: Vec<(Text<'a>, usize)>, join: Span<'a>, style: Style) -> Text<'a> {
let height = texts.iter().map(|t| t.0.height()).max().unwrap_or(0); let height = texts.iter().map(|t| t.0.height()).max().unwrap_or(0);
let mut text = Text { lines: vec![Spans(vec![join.clone()]); height] }; let mut text = Text { lines: vec![Spans(vec![join.clone()]); height] };
@ -134,7 +134,7 @@ pub fn join_cell_text<'a>(texts: Vec<(Text<'a>, usize)>, join: Span<'a>) -> Text
if let Some(spans) = t.lines.get_mut(i) { if let Some(spans) = t.lines.get_mut(i) {
text.lines[i].0.append(&mut spans.0); text.lines[i].0.append(&mut spans.0);
} else { } else {
text.lines[i].0.push(space_span(w, Style::default())); text.lines[i].0.push(space_span(w, style));
} }
text.lines[i].0.push(join.clone()); text.lines[i].0.push(join.clone());