Commit 5683a2e7a8

5683a2e7a897c9f2585f1f5f22c0fb567f019d68

parent: afe892c7fe

Unregistered key

Ulyssa <git@ulyssa.dev> · 2023-01-26 01:03 UTC

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

Layout: unified · split

src/message/html.rs +1 −1
@@ -198,7 +198,7 @@ impl Table {
198198 })
199199 .collect();
200200
201 let joined = join_cell_text(cells, Span::styled(line::VERTICAL, style));
201 let joined = join_cell_text(cells, Span::styled(line::VERTICAL, style), style);
202202 text.lines.extend(joined.lines);
203203
204204 nrows += 1;
src/util.rs +2 −2
@@ -125,7 +125,7 @@ pub fn space_text(width: usize, style: Style) -> Text<'static> {
125125 space_span(width, style).into()
126126}
127127
128pub fn join_cell_text<'a>(texts: Vec<(Text<'a>, usize)>, join: Span<'a>) -> Text<'a> {
128pub fn join_cell_text<'a>(texts: Vec<(Text<'a>, usize)>, join: Span<'a>, style: Style) -> Text<'a> {
129129 let height = texts.iter().map(|t| t.0.height()).max().unwrap_or(0);
130130 let mut text = Text { lines: vec![Spans(vec![join.clone()]); height] };
131131
@@ -134,7 +134,7 @@ pub fn join_cell_text<'a>(texts: Vec<(Text<'a>, usize)>, join: Span<'a>) -> Text
134134 if let Some(spans) = t.lines.get_mut(i) {
135135 text.lines[i].0.append(&mut spans.0);
136136 } else {
137 text.lines[i].0.push(space_span(w, Style::default()));
137 text.lines[i].0.push(space_span(w, style));
138138 }
139139
140140 text.lines[i].0.push(join.clone());