aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/clipboard.rs
diff options
context:
space:
mode:
authorKirawi2022-05-02 14:31:23 +0000
committerGitHub2022-05-02 14:31:23 +0000
commit77ff8d355051ef567c7998b226e28ba436c2e230 (patch)
tree9e3e9526bc7918f6bebc7accf5a5464662707a09 /helix-view/src/clipboard.rs
parent20162a426b991f1a07f347f8180480871d15a27a (diff)
cfg-gate unused functions on macos & windows (#2332)
Diffstat (limited to 'helix-view/src/clipboard.rs')
-rw-r--r--helix-view/src/clipboard.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs
index 8cd7983b..fed1deb1 100644
--- a/helix-view/src/clipboard.rs
+++ b/helix-view/src/clipboard.rs
@@ -14,6 +14,7 @@ pub trait ClipboardProvider: std::fmt::Debug {
fn set_contents(&mut self, contents: String, clipboard_type: ClipboardType) -> Result<()>;
}
+#[cfg(not(windows))]
macro_rules! command_provider {
(paste => $get_prg:literal $( , $get_arg:literal )* ; copy => $set_prg:literal $( , $set_arg:literal )* ; ) => {{
Box::new(provider::command::Provider {
@@ -212,14 +213,17 @@ mod provider {
use super::*;
use anyhow::{bail, Context as _, Result};
+ #[cfg(not(windows))]
pub fn exists(executable_name: &str) -> bool {
which::which(executable_name).is_ok()
}
+ #[cfg(not(any(windows, target_os = "macos")))]
pub fn env_var_is_set(env_var_name: &str) -> bool {
std::env::var_os(env_var_name).is_some()
}
+ #[cfg(not(any(windows, target_os = "macos")))]
pub fn is_exit_success(program: &str, args: &[&str]) -> bool {
std::process::Command::new(program)
.args(args)