diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index 0ca24bea..8534c90f 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -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, diff --git a/yazi-core/src/manager/commands/paste.rs b/yazi-core/src/manager/commands/paste.rs index 8b2c9530..a968bbe5 100644 --- a/yazi-core/src/manager/commands/paste.rs +++ b/yazi-core/src/manager/commands/paste.rs @@ -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(()); } } diff --git a/yazi-core/src/manager/commands/unyank.rs b/yazi-core/src/manager/commands/unyank.rs index 6071bdf9..71087693 100644 --- a/yazi-core/src/manager/commands/unyank.rs +++ b/yazi-core/src/manager/commands/unyank.rs @@ -2,8 +2,17 @@ use yazi_shared::{event::Cmd, render}; use crate::manager::Manager; +pub struct Opt; + +impl From 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) { render!(!self.yanked.is_empty()); self.yanked = Default::default();