diff options
Diffstat (limited to 'alacritty_terminal/src')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 6 | ||||
-rw-r--r-- | alacritty_terminal/src/term/cell.rs | 10 | ||||
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 8 |
3 files changed, 20 insertions, 4 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 91dd3540..8475685d 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -772,6 +772,10 @@ pub enum Attr { DoubleUnderline, /// Undercurled text. Undercurl, + /// Dotted underlined text. + DottedUnderline, + /// Dashed underlined text. + DashedUnderline, /// Blink cursor slowly. BlinkSlow, /// Blink cursor fast. @@ -1332,6 +1336,8 @@ fn attrs_from_sgr_parameters(params: &mut ParamsIter<'_>) -> Vec<Option<Attr>> { [4, 0] => Some(Attr::CancelUnderline), [4, 2] => Some(Attr::DoubleUnderline), [4, 3] => Some(Attr::Undercurl), + [4, 4] => Some(Attr::DottedUnderline), + [4, 5] => Some(Attr::DashedUnderline), [4, ..] => Some(Attr::Underline), [5] => Some(Attr::BlinkSlow), [6] => Some(Attr::BlinkFast), diff --git a/alacritty_terminal/src/term/cell.rs b/alacritty_terminal/src/term/cell.rs index 49d25eb3..2af1fbac 100644 --- a/alacritty_terminal/src/term/cell.rs +++ b/alacritty_terminal/src/term/cell.rs @@ -25,7 +25,11 @@ bitflags! { const LEADING_WIDE_CHAR_SPACER = 0b0000_0100_0000_0000; const DOUBLE_UNDERLINE = 0b0000_1000_0000_0000; const UNDERCURL = 0b0001_0000_0000_0000; - const ALL_UNDERLINES = Self::UNDERLINE.bits | Self::DOUBLE_UNDERLINE.bits | Self::UNDERCURL.bits; + const DOTTED_UNDERLINE = 0b0010_0000_0000_0000; + const DASHED_UNDERLINE = 0b0100_0000_0000_0000; + const ALL_UNDERLINES = Self::UNDERLINE.bits | Self::DOUBLE_UNDERLINE.bits + | Self::UNDERCURL.bits | Self::DOTTED_UNDERLINE.bits + | Self::DASHED_UNDERLINE.bits; } } @@ -119,9 +123,7 @@ impl GridCell for Cell { && self.fg == Color::Named(NamedColor::Foreground) && !self.flags.intersects( Flags::INVERSE - | Flags::UNDERLINE - | Flags::DOUBLE_UNDERLINE - | Flags::UNDERCURL + | Flags::ALL_UNDERLINES | Flags::STRIKEOUT | Flags::WRAPLINE | Flags::WIDE_CHAR_SPACER diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 4d30602b..5ad1b4ad 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1850,6 +1850,14 @@ impl<T: EventListener> Handler for Term<T> { cursor.template.flags.remove(Flags::ALL_UNDERLINES); cursor.template.flags.insert(Flags::UNDERCURL); }, + Attr::DottedUnderline => { + cursor.template.flags.remove(Flags::ALL_UNDERLINES); + cursor.template.flags.insert(Flags::DOTTED_UNDERLINE); + }, + Attr::DashedUnderline => { + cursor.template.flags.remove(Flags::ALL_UNDERLINES); + cursor.template.flags.insert(Flags::DASHED_UNDERLINE); + }, Attr::CancelUnderline => cursor.template.flags.remove(Flags::ALL_UNDERLINES), Attr::Hidden => cursor.template.flags.insert(Flags::HIDDEN), Attr::CancelHidden => cursor.template.flags.remove(Flags::HIDDEN), |