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