summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/main.c b/main.c
index d400f80..409c0f8 100644
--- a/main.c
+++ b/main.c
@@ -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: {