diff options
author | cflip <cflip@cflip.net> | 2023-01-17 10:39:21 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-17 10:39:21 -0700 |
commit | 1a416a917d74d956469e6e80cf4bb519e9474c91 (patch) | |
tree | 6e61b15d9cece1af0a64d3a9cd2a5d5dd73815b7 /input.c | |
parent | 8be3915417bcafdbf2a8752980db96e06df096aa (diff) |
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.
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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; |