feat: add new ya.render() API

This commit is contained in:
sxyazi 2024-01-07 19:46:46 +08:00
parent 93c8d90a51
commit 72f924b9e5
No known key found for this signature in database

View File

@ -1,7 +1,7 @@
use std::collections::BTreeMap;
use mlua::{ExternalError, Lua, Table, Value};
use yazi_shared::{emit, event::Exec, Layer};
use yazi_shared::{emit, event::Exec, render, Layer};
use super::Utils;
use crate::ValueSendable;
@ -29,6 +29,14 @@ impl Utils {
}
pub(super) fn call(lua: &Lua, ya: &Table) -> mlua::Result<()> {
ya.set(
"render",
lua.create_function(|_, ()| {
render!();
Ok(())
})?,
)?;
ya.set(
"manager_emit",
lua.create_async_function(