mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Simplify
This commit is contained in:
parent
0d12261b08
commit
45c78c6080
1 changed files with 7 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
use std::{borrow::Cow, ffi::{OsStr, OsString}, path::Path};
|
use std::{borrow::Cow, ffi::{OsStr, OsString}, path::Path};
|
||||||
|
|
||||||
use yazi_plugin::CLIPBOARD;
|
use yazi_plugin::CLIPBOARD;
|
||||||
use yazi_shared::{event::CmdCow, url::Url};
|
use yazi_shared::event::CmdCow;
|
||||||
|
|
||||||
use crate::tab::Tab;
|
use crate::tab::Tab;
|
||||||
|
|
||||||
|
|
@ -29,12 +29,13 @@ impl Tab {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut s = OsString::new();
|
let mut s = OsString::new();
|
||||||
let mut it = self.selected_or_hovered().peekable();
|
let mut it = if opt.hovered {
|
||||||
if opt.hovered {
|
Box::new(self.hovered().map(|h| &h.url).into_iter())
|
||||||
if let Some(h) = self.hovered() {
|
} else {
|
||||||
it = (Box::new(vec![&h.url].into_iter()) as Box<dyn Iterator<Item = &Url> + '_>).peekable();
|
self.selected_or_hovered()
|
||||||
} else { return };
|
|
||||||
}
|
}
|
||||||
|
.peekable();
|
||||||
|
|
||||||
while let Some(u) = it.next() {
|
while let Some(u) = it.next() {
|
||||||
s.push(match opt.type_.as_ref() {
|
s.push(match opt.type_.as_ref() {
|
||||||
"path" => opt.separator.transform(u),
|
"path" => opt.separator.transform(u),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue