From c0598823335cfdc6deb5c48fe1ead8ecea18097e Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 7 Dec 2024 17:17:22 +0100 Subject: add error type to iobuffer --- src/state/editor/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/state/editor') diff --git a/src/state/editor/mod.rs b/src/state/editor/mod.rs index 3e9d9e0..25765cc 100644 --- a/src/state/editor/mod.rs +++ b/src/state/editor/mod.rs @@ -4,6 +4,7 @@ use self::{bar::EditorBarState, buffer::Buffer, cursorshape::CursorShape}; use super::{window::Window, GlobalState, DUMMY_STATE}; use mlua::{Lua, UserData}; +use crate::lua::iobuffer; pub mod bar; pub mod buffer; @@ -35,8 +36,8 @@ impl EditorState { pub fn run(lua: &Lua) { let script = { cfg!().buffer.as_string() }; - if let Err(_error) = lua.load(script).exec() { - // TODO: add error handling + if let Err(error) = lua.load(script).exec() { + iobuffer::iobuffer().write().unwrap().error(error); } } } -- cgit v1.2.3-70-g09d2