summaryrefslogtreecommitdiff
path: root/src/widgets/luaeditor/buffer.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-08-02 00:36:10 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-08-02 00:36:10 +0200
commitfe0938b1de0c46fc2afcaa3dcd6a0f4ec870d21a (patch)
tree8db7509894842395cfb309f00c41b7f4d173888c /src/widgets/luaeditor/buffer.rs
parent1e1eb95926f556e666bc20355327abd24d264858 (diff)
add state which is shared with the lua environment
Diffstat (limited to 'src/widgets/luaeditor/buffer.rs')
-rw-r--r--src/widgets/luaeditor/buffer.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/luaeditor/buffer.rs b/src/widgets/luaeditor/buffer.rs
index 1af0c08..1427bdb 100644
--- a/src/widgets/luaeditor/buffer.rs
+++ b/src/widgets/luaeditor/buffer.rs
@@ -1,6 +1,6 @@
use std::str::FromStr;
-use super::cursor::{Cursor, CursorMove};
+use crate::cursor::{Cursor, CursorMove};
#[derive(Default, Debug, Clone)]
pub struct Buffer {
@@ -17,8 +17,7 @@ impl Buffer {
}
fn refresh_line_max(&mut self) {
- self.cursor
- .set_x_max(self.lines[self.cursor.y()].len())
+ self.cursor.set_x_max(self.lines[self.cursor.y()].len())
}
fn refresh_buffer_max(&mut self) {
@@ -143,6 +142,7 @@ impl Buffer {
| CursorMove::Down(_)
| CursorMove::Top
| CursorMove::Bottom
+ | CursorMove::Relative(_)
| CursorMove::Jump(_) => {
self.cursor.move_checked(m);
self.cursor.set_x_max(self.current_line().len());