mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
c344dcd1a1
commit
84a0d148cd
3 changed files with 10 additions and 5 deletions
|
|
@ -1,5 +1,7 @@
|
|||
use std::fmt::Display;
|
||||
|
||||
use mlua::{ExternalError, ExternalResult, IntoLua, Table, TableExt, Value, Variadic};
|
||||
use tracing::error;
|
||||
use tracing::{error, warn};
|
||||
use yazi_plugin::{LOADED, LUA};
|
||||
use yazi_shared::{emit, event::Exec, Layer};
|
||||
|
||||
|
|
@ -26,9 +28,10 @@ impl App {
|
|||
});
|
||||
}
|
||||
|
||||
pub(crate) fn plugin_do(&mut self, opt: impl TryInto<yazi_plugin::Opt>) {
|
||||
let Ok(opt) = opt.try_into() else {
|
||||
return;
|
||||
pub(crate) fn plugin_do(&mut self, opt: impl TryInto<yazi_plugin::Opt, Error = impl Display>) {
|
||||
let opt = match opt.try_into() {
|
||||
Ok(opt) => opt as yazi_plugin::Opt,
|
||||
Err(e) => return warn!("{e}"),
|
||||
};
|
||||
|
||||
let args = Variadic::from_iter(opt.data.args.into_iter().filter_map(|v| v.into_lua(&LUA).ok()));
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ pub fn cast_to_renderable(ud: AnyUserData) -> Option<Box<dyn Renderable + Send>>
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ValueSendable {
|
||||
Nil,
|
||||
Boolean(bool),
|
||||
|
|
@ -96,7 +97,7 @@ impl ValueSendable {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Hash, PartialEq, Eq)]
|
||||
#[derive(Debug, Hash, PartialEq, Eq)]
|
||||
pub enum ValueSendableKey {
|
||||
Nil,
|
||||
Boolean(bool),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use std::hash::{Hash, Hasher};
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct OrderedFloat(f64);
|
||||
|
||||
impl OrderedFloat {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue