This commit is contained in:
sxyazi 2024-02-17 19:01:52 +08:00
parent cad0e061eb
commit 349465c28b
No known key found for this signature in database
3 changed files with 15 additions and 5 deletions

View file

@ -32,9 +32,9 @@ pub struct Manager {
tab_width: u8,
// Count
count_selected: Style,
count_copied: Style,
count_cut: Style,
count_selected: Style,
// Border
pub border_symbol: String,

View file

@ -18,10 +18,11 @@ impl Manager {
let opt = opt.into() as Opt;
let dest = self.cwd();
if self.yanked.cut {
tasks.file_cut(&self.yanked, dest, opt.force);
} else {
if !self.yanked.cut {
tasks.file_copy(&self.yanked, dest, opt.force, opt.follow);
}
tasks.file_cut(&self.yanked, dest, opt.force);
self.unyank(());
}
}

View file

@ -2,8 +2,17 @@ use yazi_shared::{event::Cmd, render};
use crate::manager::Manager;
pub struct Opt;
impl From<Cmd> for Opt {
fn from(_: Cmd) -> Self { Self }
}
impl From<()> for Opt {
fn from(_: ()) -> Self { Self }
}
impl Manager {
pub fn unyank(&mut self, _: Cmd) {
pub fn unyank(&mut self, _: impl Into<Opt>) {
render!(!self.yanked.is_empty());
self.yanked = Default::default();