aboutsummaryrefslogtreecommitdiff
path: root/src/term/cell.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-12-22 17:16:54 +0000
committerGitHub <noreply@github.com>2018-12-22 17:16:54 +0000
commit2f9b815ebdcee4558284e5e9cef6ef282dc87b08 (patch)
tree09bf03e5c69d9e7e99e04ff55983ea5774435b86 /src/term/cell.rs
parentdad44134e2546dffec918a00169d32c6f9edc709 (diff)
downloadr-alacritty-2f9b815ebdcee4558284e5e9cef6ef282dc87b08.tar.gz
r-alacritty-2f9b815ebdcee4558284e5e9cef6ef282dc87b08.tar.bz2
r-alacritty-2f9b815ebdcee4558284e5e9cef6ef282dc87b08.zip
Add proper underline and strikeout support
This makes use of the new rectangle rendering methods used to display the colored visual bell to add proper underline and strikeout support to Alacritty.
Diffstat (limited to 'src/term/cell.rs')
-rw-r--r--src/term/cell.rs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/term/cell.rs b/src/term/cell.rs
index bd561482..5d3b7036 100644
--- a/src/term/cell.rs
+++ b/src/term/cell.rs
@@ -23,16 +23,17 @@ pub const MAX_ZEROWIDTH_CHARS: usize = 5;
bitflags! {
#[derive(Serialize, Deserialize)]
pub struct Flags: u16 {
- const INVERSE = 0b0_0000_0001;
- const BOLD = 0b0_0000_0010;
- const ITALIC = 0b0_0000_0100;
- const UNDERLINE = 0b0_0000_1000;
- const WRAPLINE = 0b0_0001_0000;
- const WIDE_CHAR = 0b0_0010_0000;
- const WIDE_CHAR_SPACER = 0b0_0100_0000;
- const DIM = 0b0_1000_0000;
- const DIM_BOLD = 0b0_1000_0010;
- const HIDDEN = 0b1_0000_0000;
+ const INVERSE = 0b00_0000_0001;
+ const BOLD = 0b00_0000_0010;
+ const ITALIC = 0b00_0000_0100;
+ const UNDERLINE = 0b00_0000_1000;
+ const WRAPLINE = 0b00_0001_0000;
+ const WIDE_CHAR = 0b00_0010_0000;
+ const WIDE_CHAR_SPACER = 0b00_0100_0000;
+ const DIM = 0b00_1000_0000;
+ const DIM_BOLD = 0b00_1000_0010;
+ const HIDDEN = 0b01_0000_0000;
+ const STRIKEOUT = 0b10_0000_0000;
}
}
@@ -117,7 +118,7 @@ impl Cell {
(self.c == ' ' || self.c == '\t')
&& self.extra[0] == ' '
&& self.bg == Color::Named(NamedColor::Background)
- && !self.flags.intersects(Flags::INVERSE | Flags::UNDERLINE)
+ && !self.flags.intersects(Flags::INVERSE | Flags::UNDERLINE | Flags::STRIKEOUT)
}
#[inline]