diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-02-08 20:47:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 20:47:31 +0300 |
commit | 73c3dd86280e98e11f080123aec47d08f3a76b49 (patch) | |
tree | c54d98dd763c12876235acc9880be5ec069c52b6 /alacritty_terminal/src/term | |
parent | 7263d223bf535fdffe00d5d9d398a8d188b3c185 (diff) | |
download | alacritty-73c3dd86280e98e11f080123aec47d08f3a76b49.tar.gz alacritty-73c3dd86280e98e11f080123aec47d08f3a76b49.zip |
Add support for drawing undercurls
Fixes #1628.
Diffstat (limited to 'alacritty_terminal/src/term')
-rw-r--r-- | alacritty_terminal/src/term/cell.rs | 3 | ||||
-rw-r--r-- | alacritty_terminal/src/term/mod.rs | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/alacritty_terminal/src/term/cell.rs b/alacritty_terminal/src/term/cell.rs index 64de5492..49d25eb3 100644 --- a/alacritty_terminal/src/term/cell.rs +++ b/alacritty_terminal/src/term/cell.rs @@ -24,6 +24,8 @@ bitflags! { const STRIKEOUT = 0b0000_0010_0000_0000; 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; } } @@ -119,6 +121,7 @@ impl GridCell for Cell { Flags::INVERSE | Flags::UNDERLINE | Flags::DOUBLE_UNDERLINE + | Flags::UNDERCURL | 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 50f423e5..4d30602b 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1839,16 +1839,18 @@ impl<T: EventListener> Handler for Term<T> { Attr::Italic => cursor.template.flags.insert(Flags::ITALIC), Attr::CancelItalic => cursor.template.flags.remove(Flags::ITALIC), Attr::Underline => { - cursor.template.flags.remove(Flags::DOUBLE_UNDERLINE); + cursor.template.flags.remove(Flags::ALL_UNDERLINES); cursor.template.flags.insert(Flags::UNDERLINE); }, Attr::DoubleUnderline => { - cursor.template.flags.remove(Flags::UNDERLINE); + cursor.template.flags.remove(Flags::ALL_UNDERLINES); cursor.template.flags.insert(Flags::DOUBLE_UNDERLINE); }, - Attr::CancelUnderline => { - cursor.template.flags.remove(Flags::UNDERLINE | Flags::DOUBLE_UNDERLINE); + Attr::Undercurl => { + cursor.template.flags.remove(Flags::ALL_UNDERLINES); + cursor.template.flags.insert(Flags::UNDERCURL); }, + 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), Attr::Strike => cursor.template.flags.insert(Flags::STRIKEOUT), |