diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-17 19:02:36 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-17 19:02:36 -0500 |
commit | 5d416149d4733cffd25c9deb01360468a54def2a (patch) | |
tree | 5045dc8e4e9c43c56c2546440d0ed7dfb9d54dc5 /main.c | |
parent | a5a0a5561eaab9d17cc42e491b292a33f74cde21 (diff) |
backspace
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -105,16 +105,16 @@ int main(void) { buffer_scroll(&text_buffer, 0, +buffer_display_rows(&text_buffer)); break; case SDLK_RIGHT: - buffer_cursor_move_right(&text_buffer); + buffer_cursor_move_right(&text_buffer, 1); break; case SDLK_LEFT: - buffer_cursor_move_left(&text_buffer); + buffer_cursor_move_left(&text_buffer, 1); break; case SDLK_UP: - buffer_cursor_move_up(&text_buffer); + buffer_cursor_move_up(&text_buffer, 1); break; case SDLK_DOWN: - buffer_cursor_move_down(&text_buffer); + buffer_cursor_move_down(&text_buffer, 1); break; case SDLK_RETURN: buffer_insert_char_at_cursor(&text_buffer, U'\n'); @@ -125,6 +125,9 @@ int main(void) { case SDLK_DELETE: buffer_delete_chars_at_cursor(&text_buffer, 1); break; + case SDLK_BACKSPACE: + buffer_backspace(&text_buffer, 1); + break; } } break; case SDL_TEXTINPUT: { |