Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/editor.rs')
| -rw-r--r-- | helix-view/src/editor.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 26dea3a2..48d3bc36 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1,5 +1,6 @@ use crate::{ annotations::diagnostics::{DiagnosticFilter, InlineDiagnosticsConfig}, + clipboard::ClipboardProvider, document::{ DocumentOpenError, DocumentSavedEventFuture, DocumentSavedEventResult, Mode, SavePoint, }, @@ -345,6 +346,8 @@ pub struct Config { /// Display diagnostic below the line they occur. pub inline_diagnostics: InlineDiagnosticsConfig, pub end_of_line_diagnostics: DiagnosticFilter, + // Set to override the default clipboard provider + pub clipboard_provider: ClipboardProvider, } #[derive(Debug, Clone, PartialEq, Deserialize, Serialize, Eq, PartialOrd, Ord)] @@ -982,6 +985,7 @@ impl Default for Config { jump_label_alphabet: ('a'..='z').collect(), inline_diagnostics: InlineDiagnosticsConfig::default(), end_of_line_diagnostics: DiagnosticFilter::Disable, + clipboard_provider: ClipboardProvider::default(), } } } @@ -1183,7 +1187,10 @@ impl Editor { theme_loader, last_theme: None, last_selection: None, - registers: Registers::default(), + registers: Registers::new(Box::new(arc_swap::access::Map::new( + Arc::clone(&config), + |config: &Config| &config.clipboard_provider, + ))), status_msg: None, autoinfo: None, idle_timer: Box::pin(sleep(conf.idle_timeout)), |