From 5683a2e7a897c9f2585f1f5f22c0fb567f019d68 Mon Sep 17 00:00:00 2001 From: Ulyssa Date: Wed, 25 Jan 2023 17:03:28 -0800 Subject: [PATCH] Blank lines in table cells of selected message should be highlighted (#23) --- src/message/html.rs | 2 +- src/util.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/message/html.rs b/src/message/html.rs index d006269..5435a77 100644 --- a/src/message/html.rs +++ b/src/message/html.rs @@ -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; diff --git a/src/util.rs b/src/util.rs index e667412..46a5d91 100644 --- a/src/util.rs +++ b/src/util.rs @@ -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());