mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 00:31:04 +00:00
21 lines
486 B
Rust
21 lines
486 B
Rust
use tokio::sync::mpsc;
|
|
use yazi_config::keymap::ChordArc;
|
|
use yazi_core::which::WhichOpt;
|
|
use yazi_macro::{emit, relay};
|
|
use yazi_shared::Layer;
|
|
|
|
pub struct WhichProxy;
|
|
|
|
impl WhichProxy {
|
|
pub async fn activate(cands: Vec<ChordArc>, silent: bool) -> Option<ChordArc> {
|
|
let (tx, mut rx) = mpsc::unbounded_channel();
|
|
emit!(Call(relay!(which:activate).with_any("opt", WhichOpt {
|
|
tx: Some(tx),
|
|
layer: Layer::Null,
|
|
cands,
|
|
times: 0,
|
|
silent,
|
|
})));
|
|
rx.recv().await?
|
|
}
|
|
}
|