From 1a416a917d74d956469e6e80cf4bb519e9474c91 Mon Sep 17 00:00:00 2001 From: cflip Date: Tue, 17 Jan 2023 10:39:21 -0700 Subject: Rename 'rows' to 'lines' everywhere For whatever reason lines were called rows in the code, so this refactor changes that name everywhere. The name 'row' is still used in some places to refer to the unit of height in the screen. --- input.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 74222bb..d6a9465 100644 --- a/input.c +++ b/input.c @@ -1,7 +1,8 @@ #include "input.h" #include "editor.h" -#include "row.h" +#include "file.h" +#include "line.h" void editor_process_keypress(struct editor_state *editor, SDL_Keysym *keysym) { @@ -45,8 +46,8 @@ void editor_process_keypress(struct editor_state *editor, SDL_Keysym *keysym) editor->cursor_x = 0; break; case SDLK_4: - if (keysym->mod & KMOD_SHIFT && editor->cursor_y < editor->row_count) - editor->cursor_x = editor->rows[editor->cursor_y].size; + if (keysym->mod & KMOD_SHIFT) + editor_move_end(editor); break; case SDLK_SLASH: editor_find(editor); @@ -65,7 +66,7 @@ void editor_process_keypress(struct editor_state *editor, SDL_Keysym *keysym) break; case SDLK_a: if (keysym->mod & KMOD_SHIFT) - editor->cursor_x = editor->rows[editor->cursor_y].size; + editor_move_end(editor); else editor_move_right(editor); editor->mode = EDITOR_MODE_INSERT; -- cgit v1.2.3