From 054e424875e27fcc129964e7e80aeccaf5096a8b Mon Sep 17 00:00:00 2001 From: hankertrix <91734413+hankertrix@users.noreply.github.com> Date: Fri, 2 May 2025 13:45:26 +0800 Subject: [PATCH] fix --- yazi-core/src/tab/commands/copy.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/yazi-core/src/tab/commands/copy.rs b/yazi-core/src/tab/commands/copy.rs index 79fef7cf..196461a9 100644 --- a/yazi-core/src/tab/commands/copy.rs +++ b/yazi-core/src/tab/commands/copy.rs @@ -29,8 +29,12 @@ impl Tab { } let mut s = OsString::new(); - let Some(hovered) = self.hovered() else { if opt.hovered { return } }; - let mut it = (if opt.hovered { once(hovered) } else { self.selected_or_hovered() }).peekable(); + let mut it = self.selected_or_hovered().peekable(); + if opt.hovered { + if let Some(hovered) = self.hovered { + it = once(hovered).peekable(); + } else { return }; + } while let Some(u) = it.next() { s.push(match opt.type_.as_ref() { "path" => opt.separator.transform(u),