diff options
author | Blaž Hrastnik | 2022-03-27 08:22:20 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2022-05-01 02:39:31 +0000 |
commit | ade4cbffaa9660b01bcd2ce7e6e2d6bb0a1ca3c2 (patch) | |
tree | b6af77a72251f217cefc6eff6eb7a69e74a8520e | |
parent | 9191af3f8d73d2101c46192a4a80c41a19012320 (diff) |
Add a nop clipboard provider for wasm
-rw-r--r-- | helix-view/src/clipboard.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs index 5cc5cad8..8cd7983b 100644 --- a/helix-view/src/clipboard.rs +++ b/helix-view/src/clipboard.rs @@ -75,7 +75,13 @@ pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> { } } -#[cfg(not(any(windows, target_os = "macos")))] +#[cfg(target_os = "wasm32")] +pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> { + // TODO: + Box::new(provider::NopProvider::new()) +} + +#[cfg(not(any(windows, target_os = "wasm32", target_os = "macos")))] pub fn get_clipboard_provider() -> Box<dyn ClipboardProvider> { use provider::command::{env_var_is_set, exists, is_exit_success}; // TODO: support for user-defined provider, probably when we have plugin support by setting a @@ -201,6 +207,7 @@ mod provider { } } + #[cfg(not(target_arch = "wasm32"))] pub mod command { use super::*; use anyhow::{bail, Context as _, Result}; |