aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty/src')
-rw-r--r--alacritty/src/display/content.rs9
-rw-r--r--alacritty/src/renderer/mod.rs1
-rw-r--r--alacritty/src/renderer/rects.rs7
3 files changed, 14 insertions, 3 deletions
diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs
index d2da1e81..bb3c61a8 100644
--- a/alacritty/src/display/content.rs
+++ b/alacritty/src/display/content.rs
@@ -186,6 +186,7 @@ pub struct RenderableCell {
pub fg: Rgb,
pub bg: Rgb,
pub bg_alpha: f32,
+ pub underline: Rgb,
pub flags: Flags,
}
@@ -251,14 +252,20 @@ impl RenderableCell {
let cell_point = cell.point;
let point = display::point_to_viewport(display_offset, cell_point).unwrap();
+ let flags = cell.flags;
+ let underline = cell
+ .underline_color()
+ .map_or(fg, |underline| Self::compute_fg_rgb(content, underline, flags));
+
RenderableCell {
zerowidth: cell.zerowidth().map(|zerowidth| zerowidth.to_vec()),
- flags: cell.flags,
+ flags,
character,
bg_alpha,
point,
fg,
bg,
+ underline,
}
}
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs
index cf9ee149..4a75416b 100644
--- a/alacritty/src/renderer/mod.rs
+++ b/alacritty/src/renderer/mod.rs
@@ -135,6 +135,7 @@ impl Renderer {
bg_alpha: 1.0,
fg,
bg,
+ underline: fg,
});
self.draw_cells(size_info, glyph_cache, cells);
diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs
index a4a6bf5d..27e306be 100644
--- a/alacritty/src/renderer/rects.rs
+++ b/alacritty/src/renderer/rects.rs
@@ -193,6 +193,9 @@ impl RenderLines {
return;
}
+ // The underline color escape does not apply to strikeout.
+ let color = if flag.contains(Flags::STRIKEOUT) { cell.fg } else { cell.underline };
+
// Include wide char spacer if the current cell is a wide char.
let mut end = cell.point;
if cell.flags.contains(Flags::WIDE_CHAR) {
@@ -201,7 +204,7 @@ impl RenderLines {
// Check if there's an active line.
if let Some(line) = self.inner.get_mut(&flag).and_then(|lines| lines.last_mut()) {
- if cell.fg == line.color
+ if color == line.color
&& cell.point.column == line.end.column + 1
&& cell.point.line == line.end.line
{
@@ -212,7 +215,7 @@ impl RenderLines {
}
// Start new line if there currently is none.
- let line = RenderLine { start: cell.point, end, color: cell.fg };
+ let line = RenderLine { start: cell.point, end, color };
match self.inner.get_mut(&flag) {
Some(lines) => lines.push(line),
None => {