mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-20 05:39:52 -07:00
Blank lines in table cells of selected message should be highlighted (#23)
This commit is contained in:
parent
afe892c7fe
commit
5683a2e7a8
2 changed files with 3 additions and 3 deletions
|
@ -198,7 +198,7 @@ impl Table {
|
|||
})
|
||||
.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);
|
||||
|
||||
nrows += 1;
|
||||
|
|
|
@ -125,7 +125,7 @@ pub fn space_text(width: usize, style: Style) -> Text<'static> {
|
|||
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 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) {
|
||||
text.lines[i].0.append(&mut spans.0);
|
||||
} 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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue