From 69061641770b1a98e100dd88058de59b97f2a6b9 Mon Sep 17 00:00:00 2001 From: John Kelly Date: Thu, 30 Jan 2025 23:38:07 +0000 Subject: [PATCH] Properly prevent `crossterm` features being used when `feature = "term"` not enabled in `helix-view` (#12734) --- helix-view/src/clipboard.rs | 7 ++++--- helix-view/src/graphics.rs | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs index 5e16461e0..1cf633487 100644 --- a/helix-view/src/clipboard.rs +++ b/helix-view/src/clipboard.rs @@ -122,10 +122,11 @@ mod external { Self::Tmux } else if binary_exists("pbcopy") && binary_exists("pbpaste") { Self::Pasteboard - } else if cfg!(feature = "term") { - Self::Termcode } else { - Self::None + #[cfg(feature = "term")] + return Self::Termcode; + #[cfg(not(feature = "term"))] + return Self::None; } } diff --git a/helix-view/src/graphics.rs b/helix-view/src/graphics.rs index fcc037ed1..3cd3c8626 100644 --- a/helix-view/src/graphics.rs +++ b/helix-view/src/graphics.rs @@ -342,6 +342,7 @@ impl FromStr for UnderlineStyle { } } +#[cfg(feature = "term")] impl From for crossterm::style::Attribute { fn from(style: UnderlineStyle) -> Self { match style {