mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
4631d20bc0
commit
baa1c43d67
2 changed files with 9 additions and 3 deletions
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ impl<'a> TryFrom<mlua::Table<'a>> for NotifyOpt {
|
|||
fn try_from(t: mlua::Table) -> Result<Self, Self::Error> {
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue