From 617db1d87703e929390a3ea04d189a25c4aaa026 Mon Sep 17 00:00:00 2001 From: cflip Date: Mon, 16 Jan 2023 10:48:09 -0700 Subject: Implement some more commands from vim --- editor.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'editor.c') diff --git a/editor.c b/editor.c index 9f51188..016fa2e 100644 --- a/editor.c +++ b/editor.c @@ -140,6 +140,19 @@ void editor_delete_char(struct editor_state* editor) } } +void editor_add_line_above(struct editor_state* editor) +{ + insert_row(editor, editor->cursor_y, "", 0); + editor->cursor_x = 0; +} + +void editor_add_line_below(struct editor_state* editor) +{ + insert_row(editor, editor->cursor_y + 1, "", 0); + editor->cursor_y++; + editor->cursor_x = 0; +} + static void editor_find_callback(struct editor_state* editor, char* query, int key) { static int last_match = -1; -- cgit v1.2.3