mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
16 lines
390 B
Rust
16 lines
390 B
Rust
use tokio::sync::oneshot;
|
|
use yazi_config::popup::SelectCfg;
|
|
use yazi_shared::{emit, event::Cmd, Layer};
|
|
|
|
use crate::options::SelectOpt;
|
|
|
|
pub struct SelectProxy;
|
|
|
|
impl SelectProxy {
|
|
#[inline]
|
|
pub async fn show(cfg: SelectCfg) -> anyhow::Result<usize> {
|
|
let (tx, rx) = oneshot::channel();
|
|
emit!(Call(Cmd::new("show").with_data(SelectOpt { cfg, tx }), Layer::Select));
|
|
rx.await?
|
|
}
|
|
}
|