mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
feat: add new ya.render() API
This commit is contained in:
parent
93c8d90a51
commit
72f924b9e5
1 changed files with 9 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue