From 86406153bdf32b910cff7e987ef1806d97867e89 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 2 Aug 2022 17:31:40 -0700 Subject: [PATCH] fixed styles --- crates/terminal/src/connected_el.rs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/crates/terminal/src/connected_el.rs b/crates/terminal/src/connected_el.rs index 27ec24de2e33eb67d5600f4990721c4a8e086439..1a804b4154fb051f041e6afb988525cece8dc3e5 100644 --- a/crates/terminal/src/connected_el.rs +++ b/crates/terminal/src/connected_el.rs @@ -368,14 +368,7 @@ impl TerminalEl { let fg = convert_color(&fg, &style.colors, modal); let underline = flags - .contains( - Flags::UNDERLINE - | Flags::DOUBLE_UNDERLINE - | Flags::DOTTED_UNDERLINE - | Flags::DASHED_UNDERLINE - | Flags::UNDERCURL - | Flags::ALL_UNDERLINES, - ) + .intersects(Flags::ALL_UNDERLINES) .then(|| Underline { color: Some(fg), squiggly: flags.contains(Flags::UNDERCURL), @@ -386,11 +379,11 @@ impl TerminalEl { let mut properties = Properties::new(); if indexed .flags - .contains(Flags::BOLD | Flags::BOLD_ITALIC | Flags::DIM_BOLD) + .intersects(Flags::BOLD | Flags::BOLD_ITALIC | Flags::DIM_BOLD) { properties = *properties.weight(Weight::BOLD); } - if indexed.flags.contains(Flags::ITALIC | Flags::BOLD_ITALIC) { + if indexed.flags.intersects(Flags::ITALIC | Flags::BOLD_ITALIC) { properties = *properties.style(Italic); } @@ -598,12 +591,13 @@ impl Element for TerminalEl { cells.extend( content .display_iter - .filter(|ic| { - !ic.flags.contains(Flags::HIDDEN) - && !(ic.bg == Named(NamedColor::Background) - && ic.c == ' ' - && !ic.flags.contains(Flags::INVERSE)) - }) + //TODO: Add this once there's a way to retain empty lines + // .filter(|ic| { + // !ic.flags.contains(Flags::HIDDEN) + // && !(ic.bg == Named(NamedColor::Background) + // && ic.c == ' ' + // && !ic.flags.contains(Flags::INVERSE)) + // }) .map(|ic| IndexedCell { point: ic.point.clone(), cell: ic.cell.clone(),