nvim-oxi/examples/mlua.rs
Riccardo Mazzarini a72ad38339
Fix nvim_oxi::api::notify() (#208)
* Remove `mlua` from the `dev-dependencies`

* Test `api::notify()`

* Fix `api::notify()`'s API

* Test `api::notify()` w/ custom provider

* Add an `Arena` argument to `nvim_notify` on 0.10 and Nightly

* Directly implement `Error` for `types::Error`

* Test that errors returned by `vim.notify` are propagated

* Fix using `mlua` in CI

* Don't test `notify_custom{_err}` on `v0.9.5` on macOS and Windows
2024-12-27 03:28:46 +08:00

11 lines
302 B
Rust

use mlua::prelude::LuaFunction;
use nvim_oxi::{mlua, print, Result};
#[nvim_oxi::plugin]
fn mlua() -> Result<()> {
print!("Hello from nvim-oxi..");
let lua = mlua::lua();
let print: LuaFunction = lua.globals().get("print")?;
print.call::<()>("..and goodbye from mlua!")?;
Ok(())
}