on master help sign in
Add a nop clipboard provider for wasm
commitade4cbffaa9660b01bcd2ce7e6e2d6bb0a1ca3c2 authorBlaž Hrastnik <blaz@mxxn.io> dateSun 27 Mar 2022, 17:22 (5 years ago) parent9191af3
1 file changed+8−1
helix-view/src/clipboard.rs+8−1
helix-view/src/clipboard.rs+8−1
@@ -75,7 +75,13 @@ pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> {
7575 }
7676}
7777
78−#[cfg(not(any(windows, target_os = "macos")))]
78+#[cfg(target_os = "wasm32")]
79+pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> {
80+ // TODO:
81+ Box::new(provider::NopProvider::new())
82+}
83+
84+#[cfg(not(any(windows, target_os = "wasm32", target_os = "macos")))]
7985pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> {
8086 use provider::command::{env_var_is_set, exists, is_exit_success};
8187 // TODO: support for user-defined provider, probably when we have plugin support by setting a
@@ -201,6 +207,7 @@ mod provider {
201207 }
202208 }
203209
210+ #[cfg(not(target_arch = "wasm32"))]
204211 pub mod command {
205212 use super::*;
206213 use anyhow::{bail, Context as _, Result};