Added some insertion keybinds

This commit is contained in:
Ceferino Patino 2025-01-11 17:48:20 -06:00
commit 883d25f4b8
Signed by: c4patino
SSH key fingerprint: SHA256:9fQ9TsujGrdNNi76mnsu63v7dS5JOmHRZEqBOl49OR8

View file

@ -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(())
});