From 883d25f4b8888462b49bfac16f64c8ffa580ea36 Mon Sep 17 00:00:00 2001 From: C4 Patino Date: Sat, 11 Jan 2025 17:48:20 -0600 Subject: [PATCH] Added some insertion keybinds --- src/macros.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index ec580e8..a26b0bc 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -163,14 +163,16 @@ pub fn default_keybinds(editor: &mut Editor) { }); add_keybind!(editor, "n", "o", |e| { - e.buffer.insert(e.display.cursor.position.1 as usize - 1, String::new()); + e.buffer.insert(e.display.cursor.position.1 as usize + 1, String::new()); e.display.cursor.move_by((0, 1), &e.buffer); + e.mode = Mode::INSERT; Ok(()) }); add_keybind!(editor, "n", "O", |e| { e.buffer.insert(e.display.cursor.position.1 as usize, String::new()); - e.display.cursor.move_by((0, -1), &e.buffer); + e.display.cursor.move_by((0, 0), &e.buffer); + e.mode = Mode::INSERT; Ok(()) });