Move hover event to hover command to accommodate all edge cases

This commit is contained in:
sxyazi 2024-06-23 18:19:04 +08:00
parent 6d3fa28bfb
commit fbfab5ae87
No known key found for this signature in database
3 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,6 @@
use std::collections::HashSet;
use yazi_dds::Pubsub;
use yazi_shared::{event::{Cmd, Data}, fs::Url, render};
use crate::manager::Manager;
@ -42,5 +43,8 @@ impl Manager {
}
}
self.watcher.watch(to_watch);
// Publish through DDS
Pubsub::pub_from_hover(self.active().idx, self.hovered().map(|h| &h.url));
}
}

View file

@ -1,4 +1,3 @@
use yazi_dds::Pubsub;
use yazi_proxy::ManagerProxy;
use yazi_shared::{event::{Cmd, Data}, render};
@ -44,7 +43,6 @@ impl Tab {
}
}
Pubsub::pub_from_hover(self.idx, self.current.hovered().map(|h| &h.url));
ManagerProxy::hover(None);
render!();
}

View file

@ -66,7 +66,6 @@ impl Tab {
}
Pubsub::pub_from_cd(self.idx, &self.current.cwd);
Pubsub::pub_from_hover(self.idx, self.current.hovered().map(|h| &h.url));
ManagerProxy::refresh();
render!();
}