From 90daf295c7dd5fedc3219b8947fac110f05cc522 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 3 Aug 2024 11:06:14 +0200 Subject: add editor keymap --- src/state/editor/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/state/editor/mod.rs') diff --git a/src/state/editor/mod.rs b/src/state/editor/mod.rs index 058bbf6..47d11bc 100644 --- a/src/state/editor/mod.rs +++ b/src/state/editor/mod.rs @@ -1,3 +1,5 @@ +use crate::cursor::CursorMove; + use self::{bar::EditorBarState, buffer::Buffer}; use super::{GlobalState, DUMMY_STATE}; @@ -84,6 +86,11 @@ impl UserData for EditorState { methods.add_function("run", |lua, _: ()| { EditorState::run(lua); Ok(()) + }); + + methods.add_function("move_cursor", |_, m: CursorMove| { + cfg_mut!().buffer.move_cursor(m); + Ok(()) }) } } -- cgit v1.2.3-70-g09d2