mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
5d786c8ec5
commit
abcfd6cfcf
2 changed files with 8 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
use tracing::error;
|
||||||
use yazi_shared::event::Cmd;
|
use yazi_shared::event::Cmd;
|
||||||
|
|
||||||
use crate::which::Which;
|
use crate::which::Which;
|
||||||
|
|
@ -21,8 +22,12 @@ impl TryFrom<Cmd> for Opt {
|
||||||
|
|
||||||
impl Which {
|
impl Which {
|
||||||
pub fn callback(&mut self, opt: impl TryInto<Opt>) {
|
pub fn callback(&mut self, opt: impl TryInto<Opt>) {
|
||||||
if let Ok(opt) = opt.try_into() {
|
let Ok(opt) = opt.try_into() else {
|
||||||
opt.tx.try_send(opt.idx).ok();
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
if opt.tx.try_send(opt.idx).is_err() {
|
||||||
|
error!("callback: send error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ impl Utils {
|
||||||
Layer::Which
|
Layer::Which
|
||||||
));
|
));
|
||||||
|
|
||||||
Ok(rx.recv().await)
|
Ok(rx.recv().await.map(|idx| idx + 1))
|
||||||
})?,
|
})?,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue