Blank lines in table cells of selected message should be highlighted (#23)
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user