mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
cad0e061eb
commit
349465c28b
3 changed files with 15 additions and 5 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue