make sharing to clipboard a feature that can be disabled
this is for users that want to eliminate dependences (e.g. libxcb). the feature is enabled by default and must be explicitly disabled. fixes #84
This commit is contained in:
@@ -9,6 +9,7 @@ use cursive::view::ScrollBase;
|
||||
use cursive::{Cursive, Printer, Rect, Vec2};
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
#[cfg(feature = "share_clipboard")]
|
||||
use clipboard::{ClipboardContext, ClipboardProvider};
|
||||
use command::{Command, GotoMode, MoveMode, TargetMode};
|
||||
use commands::CommandResult;
|
||||
@@ -321,6 +322,7 @@ impl<I: ListItem + Clone> ViewExt for ListView<I> {
|
||||
};
|
||||
|
||||
if let Some(url) = url {
|
||||
#[cfg(feature = "share_clipboard")]
|
||||
ClipboardProvider::new()
|
||||
.and_then(|mut ctx: ClipboardContext| ctx.set_contents(url))
|
||||
.ok();
|
||||
|
||||
Reference in New Issue
Block a user