mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
b9b14f3583
commit
1d299b0533
12 changed files with 23 additions and 86 deletions
|
|
@ -6,7 +6,7 @@ use crate::mgr::Mgr;
|
||||||
|
|
||||||
impl Mgr {
|
impl Mgr {
|
||||||
#[yazi_codegen::command]
|
#[yazi_codegen::command]
|
||||||
pub fn watch(&mut self, _: Opt) {
|
pub fn watch(&mut self, _: WatchOpt) {
|
||||||
let it = iter::once(self.tabs.active().cwd())
|
let it = iter::once(self.tabs.active().cwd())
|
||||||
.chain(self.tabs.parent().map(|p| &p.url))
|
.chain(self.tabs.parent().map(|p| &p.url))
|
||||||
.chain(self.tabs.hovered().filter(|h| h.is_dir()).map(|h| &h.url));
|
.chain(self.tabs.hovered().filter(|h| h.is_dir()).map(|h| &h.url));
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ impl Watcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn watch<'a>(&mut self, it: impl Iterator<Item = &'a Url>) {
|
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>) {
|
pub(super) fn push_files(&self, urls: Vec<Url>) {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type EscapeOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct EscapeOpt;
|
|
||||||
|
|
||||||
impl From<CmdCow> for EscapeOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<()> for EscapeOpt {
|
|
||||||
fn from(_: ()) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
yazi_macro::mod_pub!(cmp confirm help input mgr notify pick spot tab tasks which);
|
yazi_macro::mod_pub!(cmp confirm help input mgr notify pick spot tab tasks which);
|
||||||
|
|
||||||
|
yazi_macro::mod_flat!(void);
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type UnyankOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct UnyankOpt;
|
|
||||||
|
|
||||||
impl From<CmdCow> for UnyankOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<()> for UnyankOpt {
|
|
||||||
fn from(_: ()) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type WatchOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct WatchOpt;
|
|
||||||
|
|
||||||
impl From<CmdCow> for WatchOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<()> for WatchOpt {
|
|
||||||
fn from((): ()) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type CloseOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct CloseOpt;
|
|
||||||
|
|
||||||
impl From<CmdCow> for CloseOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<()> for CloseOpt {
|
|
||||||
fn from(_: ()) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type FollowOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct FollowOpt;
|
|
||||||
|
|
||||||
impl From<CmdCow> for FollowOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type LeaveOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct LeaveOpt;
|
|
||||||
|
|
||||||
impl From<()> for LeaveOpt {
|
|
||||||
fn from(_: ()) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<CmdCow> for LeaveOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type CloseOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct CloseOpt;
|
|
||||||
|
|
||||||
impl From<CmdCow> for CloseOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<()> for CloseOpt {
|
|
||||||
fn from(_: ()) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1 @@
|
||||||
use yazi_shared::event::CmdCow;
|
pub type ShowOpt = crate::VoidOpt;
|
||||||
|
|
||||||
pub struct ShowOpt;
|
|
||||||
|
|
||||||
impl From<CmdCow> for ShowOpt {
|
|
||||||
fn from(_: CmdCow) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<()> for ShowOpt {
|
|
||||||
fn from(_: ()) -> Self { Self }
|
|
||||||
}
|
|
||||||
|
|
|
||||||
11
yazi-parser/src/void.rs
Normal file
11
yazi-parser/src/void.rs
Normal 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 }
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue