Skip to content

Commit 9d94a6d

Browse files
committed
MSC4352 small fixes with os
Signed-off-by: Igor Somov <[email protected]>
1 parent 1d266fd commit 9d94a6d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,10 +770,16 @@ impl Application {
770770
// Try to copy to clipboard if available
771771
#[cfg(feature = "desktop")]
772772
{
773-
use modalkit::clipboard::ClipboardProvider;
774-
if let Ok(mut clipboard) = modalkit::clipboard::ClipboardProvider::new() {
775-
let _ = clipboard.set_contents(permalink.clone());
776-
}
773+
use modalkit::prelude::{Register, TargetShape};
774+
use modalkit::editing::rope::EditRope;
775+
use modalkit::editing::store::{RegisterCell, RegisterPutFlags};
776+
777+
let cell = RegisterCell {
778+
value: EditRope::from(permalink.clone()),
779+
shape: TargetShape::LineWise,
780+
};
781+
782+
let _ = store.registers.put(&Register::SelectionClipboard, cell, RegisterPutFlags::NONE);
777783
}
778784

779785
let msg = format!("Permalink: {} (copied to clipboard)", permalink);

0 commit comments

Comments
 (0)