This commit is contained in:
sxyazi 2025-07-06 22:25:51 +08:00
parent b9b14f3583
commit 1d299b0533
No known key found for this signature in database
12 changed files with 23 additions and 86 deletions

View file

@ -6,7 +6,7 @@ use crate::mgr::Mgr;
impl Mgr {
#[yazi_codegen::command]
pub fn watch(&mut self, _: Opt) {
pub fn watch(&mut self, _: WatchOpt) {
let it = iter::once(self.tabs.active().cwd())
.chain(self.tabs.parent().map(|p| &p.url))
.chain(self.tabs.hovered().filter(|h| h.is_dir()).map(|h| &h.url));

View file

@ -52,7 +52,7 @@ impl Watcher {
}
pub(super) fn watch<'a>(&mut self, it: impl Iterator<Item = &'a Url>) {
self.in_tx.send(it.into_iter().filter(|u| u.is_regular()).cloned().collect()).ok();
self.in_tx.send(it.filter(|u| u.is_regular()).cloned().collect()).ok();
}
pub(super) fn push_files(&self, urls: Vec<Url>) {

View file

@ -1,11 +1 @@
use yazi_shared::event::CmdCow;
pub struct EscapeOpt;
impl From<CmdCow> for EscapeOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for EscapeOpt {
fn from(_: ()) -> Self { Self }
}
pub type EscapeOpt = crate::VoidOpt;

View file

@ -1 +1,3 @@
yazi_macro::mod_pub!(cmp confirm help input mgr notify pick spot tab tasks which);
yazi_macro::mod_flat!(void);

View file

@ -1,11 +1 @@
use yazi_shared::event::CmdCow;
pub struct UnyankOpt;
impl From<CmdCow> for UnyankOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for UnyankOpt {
fn from(_: ()) -> Self { Self }
}
pub type UnyankOpt = crate::VoidOpt;

View file

@ -1,11 +1 @@
use yazi_shared::event::CmdCow;
pub struct WatchOpt;
impl From<CmdCow> for WatchOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for WatchOpt {
fn from((): ()) -> Self { Self }
}
pub type WatchOpt = crate::VoidOpt;

View file

@ -1,11 +1 @@
use yazi_shared::event::CmdCow;
pub struct CloseOpt;
impl From<CmdCow> for CloseOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for CloseOpt {
fn from(_: ()) -> Self { Self }
}
pub type CloseOpt = crate::VoidOpt;

View file

@ -1,7 +1 @@
use yazi_shared::event::CmdCow;
pub struct FollowOpt;
impl From<CmdCow> for FollowOpt {
fn from(_: CmdCow) -> Self { Self }
}
pub type FollowOpt = crate::VoidOpt;

View file

@ -1,11 +1 @@
use yazi_shared::event::CmdCow;
pub struct LeaveOpt;
impl From<()> for LeaveOpt {
fn from(_: ()) -> Self { Self }
}
impl From<CmdCow> for LeaveOpt {
fn from(_: CmdCow) -> Self { Self }
}
pub type LeaveOpt = crate::VoidOpt;

View file

@ -1,11 +1 @@
use yazi_shared::event::CmdCow;
pub struct CloseOpt;
impl From<CmdCow> for CloseOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for CloseOpt {
fn from(_: ()) -> Self { Self }
}
pub type CloseOpt = crate::VoidOpt;

View file

@ -1,11 +1 @@
use yazi_shared::event::CmdCow;
pub struct ShowOpt;
impl From<CmdCow> for ShowOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for ShowOpt {
fn from(_: ()) -> Self { Self }
}
pub type ShowOpt = crate::VoidOpt;

11
yazi-parser/src/void.rs Normal file
View file

@ -0,0 +1,11 @@
use yazi_shared::event::CmdCow;
pub struct VoidOpt;
impl From<CmdCow> for VoidOpt {
fn from(_: CmdCow) -> Self { Self }
}
impl From<()> for VoidOpt {
fn from(_: ()) -> Self { Self }
}