diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-03 11:06:14 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-03 11:06:14 +0200 |
| commit | 90daf295c7dd5fedc3219b8947fac110f05cc522 (patch) | |
| tree | a8cc7dba65f1c8a6b7ed5e528e65bc86885d3c22 /src/state | |
| parent | cd907dd59a48c2aa9d602aa3fb2f24563994420e (diff) | |
add editor keymap
Diffstat (limited to 'src/state')
| -rw-r--r-- | src/state/editor/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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(()) }) } } |