diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-03-16 19:27:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-16 19:27:55 +0300 |
commit | f4bdf5fb36fdf3b329be8253da39050abe7238a5 (patch) | |
tree | 9b49a78b15fdd73850a7bfc279e3986af2b59683 /alacritty/src/display/content.rs | |
parent | 589c1e9c6b8830625162af14a9a7aee32c7aade0 (diff) | |
download | r-alacritty-f4bdf5fb36fdf3b329be8253da39050abe7238a5.tar.gz r-alacritty-f4bdf5fb36fdf3b329be8253da39050abe7238a5.tar.bz2 r-alacritty-f4bdf5fb36fdf3b329be8253da39050abe7238a5.zip |
Add colored underline support
This commit adds support for colored underline and refines the dynamic
extra storage. The extra storage now is using `Arc` making cloning it way
faster compared to `Box` approach which scales really well when it comes
to cloning in `Term::write_at_cursor`, since cloning `Arc` is constant
time.
Fixes #4142.
Diffstat (limited to 'alacritty/src/display/content.rs')
-rw-r--r-- | alacritty/src/display/content.rs | 9 |
1 files changed, 8 insertions, 1 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, } } |