diff --git a/yazi-plugin/src/utils/layer.rs b/yazi-plugin/src/utils/layer.rs index 3f70ff9e..90bff80a 100644 --- a/yazi-plugin/src/utils/layer.rs +++ b/yazi-plugin/src/utils/layer.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use mlua::{ExternalError, ExternalResult, IntoLuaMulti, Lua, Table, Value}; use tokio::sync::mpsc; use yazi_config::{keymap::{Control, Key}, popup::InputCfg}; -use yazi_proxy::InputProxy; +use yazi_proxy::{AppProxy, InputProxy}; use yazi_shared::{emit, event::Cmd, Layer}; use super::Utils; @@ -79,7 +79,13 @@ impl Utils { })?, )?; - ya.raw_set("notify", lua.create_function(|lua, t: Table| Ok(()))?)?; + ya.raw_set( + "notify", + lua.create_function(|_, t: Table| { + AppProxy::notify(t.try_into()?); + Ok(()) + })?, + )?; Ok(()) } diff --git a/yazi-proxy/src/options/notify.rs b/yazi-proxy/src/options/notify.rs index c99e047d..bc4f860a 100644 --- a/yazi-proxy/src/options/notify.rs +++ b/yazi-proxy/src/options/notify.rs @@ -23,7 +23,7 @@ impl<'a> TryFrom> for NotifyOpt { fn try_from(t: mlua::Table) -> Result { let timeout = t.raw_get::<_, f64>("timeout")?; if timeout < 0.0 { - return Err("invalid timeout".into_lua_err()); + return Err("timeout must be non-negative".into_lua_err()); } Ok(Self {