mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
65003337f9
commit
029375c77f
2 changed files with 13 additions and 13 deletions
|
|
@ -21,7 +21,7 @@ impl<'a> BodyBulk<'a> {
|
||||||
|
|
||||||
impl BodyBulk<'static> {
|
impl BodyBulk<'static> {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn dummy(tab: usize, changes: &HashMap<Url, Url>) -> Body<'static> {
|
pub fn owned(tab: usize, changes: &HashMap<Url, Url>) -> Body<'static> {
|
||||||
Self { tab, changes: Cow::Owned(changes.clone()) }.into()
|
Self { tab, changes: Cow::Owned(changes.clone()) }.into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,18 +118,6 @@ impl Pubsub {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pub_from_bulk(tab: usize, changes: &HashMap<Url, Url>) {
|
|
||||||
if LOCAL.read().contains_key("bulk") {
|
|
||||||
Self::pub_(BodyBulk::dummy(tab, changes));
|
|
||||||
}
|
|
||||||
if PEERS.read().values().any(|p| p.able("bulk")) {
|
|
||||||
Client::push(BodyBulk::borrowed(tab, changes));
|
|
||||||
}
|
|
||||||
if BOOT.local_events.contains("bulk") {
|
|
||||||
BodyBulk::borrowed(tab, changes).with_receiver(*ID).flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn pub_from_rename(tab: usize, from: &Url, to: &Url) {
|
pub fn pub_from_rename(tab: usize, from: &Url, to: &Url) {
|
||||||
if LOCAL.read().contains_key("rename") {
|
if LOCAL.read().contains_key("rename") {
|
||||||
Self::pub_(BodyRename::dummy(tab, from, to));
|
Self::pub_(BodyRename::dummy(tab, from, to));
|
||||||
|
|
@ -142,6 +130,18 @@ impl Pubsub {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn pub_from_bulk(tab: usize, changes: &HashMap<Url, Url>) {
|
||||||
|
if LOCAL.read().contains_key("bulk") {
|
||||||
|
Self::pub_(BodyBulk::owned(tab, changes));
|
||||||
|
}
|
||||||
|
if PEERS.read().values().any(|p| p.able("bulk")) {
|
||||||
|
Client::push(BodyBulk::borrowed(tab, changes));
|
||||||
|
}
|
||||||
|
if BOOT.local_events.contains("bulk") {
|
||||||
|
BodyBulk::borrowed(tab, changes).with_receiver(*ID).flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn pub_from_yank(cut: bool, urls: &HashSet<Url>) {
|
pub fn pub_from_yank(cut: bool, urls: &HashSet<Url>) {
|
||||||
if LOCAL.read().contains_key("yank") {
|
if LOCAL.read().contains_key("yank") {
|
||||||
Self::pub_(BodyYank::dummy());
|
Self::pub_(BodyYank::dummy());
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue