diff options
author | Gokul Soumya | 2022-07-08 22:05:06 +0000 |
---|---|---|
committer | Pascal Kuthe | 2022-10-01 15:00:32 +0000 |
commit | 999b45b28c157418c20a9a8cd9219db6ce0beac7 (patch) | |
tree | 2e865dec1254cfe759b04c72ece5e7d2af5d0991 /helix-tui | |
parent | c9584251f321a8540cf530561896b2f48f0b76a2 (diff) |
Support different kinds of underline rendering
Adds four new modifiers that can be used in themes:
- undercurled
- underdashed
- underdotted
- double-underline
Diffstat (limited to 'helix-tui')
-rw-r--r-- | helix-tui/src/backend/crossterm.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs index eff098b3..252036f3 100644 --- a/helix-tui/src/backend/crossterm.rs +++ b/helix-tui/src/backend/crossterm.rs @@ -153,7 +153,7 @@ impl ModifierDiff { if removed.contains(Modifier::ITALIC) { map_error(queue!(w, SetAttribute(CAttribute::NoItalic)))?; } - if removed.contains(Modifier::UNDERLINED) { + if removed.intersects(Modifier::ANY_UNDERLINE) { map_error(queue!(w, SetAttribute(CAttribute::NoUnderline)))?; } if removed.contains(Modifier::DIM) { @@ -179,6 +179,18 @@ impl ModifierDiff { if added.contains(Modifier::UNDERLINED) { map_error(queue!(w, SetAttribute(CAttribute::Underlined)))?; } + if added.contains(Modifier::UNDERCURLED) { + map_error(queue!(w, SetAttribute(CAttribute::Undercurled)))?; + } + if added.contains(Modifier::UNDERDOTTED) { + map_error(queue!(w, SetAttribute(CAttribute::Underdotted)))?; + } + if added.contains(Modifier::UNDERDASHED) { + map_error(queue!(w, SetAttribute(CAttribute::Underdashed)))?; + } + if added.contains(Modifier::DOUBLE_UNDERLINED) { + map_error(queue!(w, SetAttribute(CAttribute::DoubleUnderlined)))?; + } if added.contains(Modifier::DIM) { map_error(queue!(w, SetAttribute(CAttribute::Dim)))?; } |