Skip to content

Commit

Permalink
crossterm: Handle 'hidden' modifier (helix-editor#8120)
Browse files Browse the repository at this point in the history
Crossterm supports the 'hidden' SGR parameter but we previously didn't
set the attribute when the "hidden" modifier was specified in a theme.
  • Loading branch information
the-mikedavis committed Aug 31, 2023
1 parent 6bef982 commit a276726
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions helix-tui/src/backend/crossterm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ impl ModifierDiff {
if removed.contains(Modifier::SLOW_BLINK) || removed.contains(Modifier::RAPID_BLINK) {
queue!(w, SetAttribute(CAttribute::NoBlink))?;
}
if removed.contains(Modifier::HIDDEN) {
queue!(w, SetAttribute(CAttribute::NoHidden))?;
}

let added = self.to - self.from;
if added.contains(Modifier::REVERSED) {
Expand All @@ -351,6 +354,9 @@ impl ModifierDiff {
if added.contains(Modifier::RAPID_BLINK) {
queue!(w, SetAttribute(CAttribute::RapidBlink))?;
}
if added.contains(Modifier::HIDDEN) {
queue!(w, SetAttribute(CAttribute::Hidden))?;
}

Ok(())
}
Expand Down

0 comments on commit a276726

Please sign in to comment.