mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
a262ff3496
commit
51214351a8
1 changed files with 14 additions and 11 deletions
|
|
@ -21,17 +21,20 @@ impl Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
let (tx, mut rx) = mpsc::channel::<usize>(1);
|
let (tx, mut rx) = mpsc::channel::<usize>(1);
|
||||||
let mut cands = Vec::with_capacity(t.raw_len());
|
let cands: Vec<_> = t
|
||||||
|
.raw_get::<Table>("cands")?
|
||||||
for (i, cand) in t.raw_get::<Table>("cands")?.sequence_values::<Table>().enumerate() {
|
.sequence_values::<Table>()
|
||||||
|
.enumerate()
|
||||||
|
.map(|(i, cand)| {
|
||||||
let cand = cand?;
|
let cand = cand?;
|
||||||
cands.push(Chord {
|
Ok(Chord {
|
||||||
on: Self::parse_keys(cand.raw_get("on")?)?,
|
on: Self::parse_keys(cand.raw_get("on")?)?,
|
||||||
run: vec![relay!(which:callback, [i]).with_any("tx", tx.clone())],
|
run: vec![relay!(which:callback, [i]).with_any("tx", tx.clone())],
|
||||||
desc: cand.raw_get("desc").ok(),
|
desc: cand.raw_get("desc").ok(),
|
||||||
r#for: None,
|
r#for: None,
|
||||||
});
|
})
|
||||||
}
|
})
|
||||||
|
.collect::<mlua::Result<_>>()?;
|
||||||
|
|
||||||
drop(tx);
|
drop(tx);
|
||||||
WhichProxy::show(ShowOpt { cands, silent: t.raw_get("silent").unwrap_or_default() });
|
WhichProxy::show(ShowOpt { cands, silent: t.raw_get("silent").unwrap_or_default() });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue