diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-03 10:30:14 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-03 10:30:14 +0200 |
| commit | cd907dd59a48c2aa9d602aa3fb2f24563994420e (patch) | |
| tree | 33a1d783dc98a09b09fdcaf039bdcee9912dadd5 /src/state/view | |
| parent | eafde55afcdf9dc4c17c6c97c1db472fc9ff9957 (diff) | |
implement into_luamulti for cursor move
Diffstat (limited to 'src/state/view')
| -rw-r--r-- | src/state/view/mod.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/state/view/mod.rs b/src/state/view/mod.rs index b142227..961c4ca 100644 --- a/src/state/view/mod.rs +++ b/src/state/view/mod.rs @@ -14,8 +14,8 @@ use crate::{ }, }; -pub mod mode; pub mod bar; +pub mod mode; #[derive(Default, Debug)] pub struct SheetViewState { @@ -172,16 +172,12 @@ impl UserData for SheetViewState { Ok(()) }); - fields.add_field_function_get("bar", |_, _| { - Ok(DUMMY_STATE.view.bar) - }) + fields.add_field_function_get("bar", |_, _| Ok(DUMMY_STATE.view.bar)) } fn add_methods<'lua, M: mlua::prelude::LuaUserDataMethods<'lua, Self>>(methods: &mut M) { - methods.add_function("move_cursor", |_, (row, column): (usize, usize)| { - cfg_mut!() - .cursor - .move_checked(CursorMove::Jump((column, row))); + methods.add_function("move_cursor", |_, m: CursorMove| { + cfg_mut!().cursor.move_checked(m); Ok(()) }); |