diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-16 00:25:35 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-16 00:25:35 -0500 |
commit | a5a0a5561eaab9d17cc42e491b292a33f74cde21 (patch) | |
tree | 74aecfa69abbf7817b08c685928b83422ffbff33 /main.c | |
parent | 04a85e2c801a4610c80240e5a993f49039cd954f (diff) |
fixed problem with adding lines; delete key
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -69,7 +69,7 @@ int main(void) { buffer_create(&text_buffer, font); { - FILE *fp = fopen("main.c", "rb"); + FILE *fp = fopen("test.txt", "rb"); assert(fp); bool success = buffer_load_file(&text_buffer, fp); fclose(fp); @@ -122,6 +122,9 @@ int main(void) { case SDLK_TAB: buffer_insert_char_at_cursor(&text_buffer, U'\t'); break; + case SDLK_DELETE: + buffer_delete_chars_at_cursor(&text_buffer, 1); + break; } } break; case SDL_TEXTINPUT: { @@ -182,6 +185,7 @@ int main(void) { } //buffer_print_debug(&text_buffer); + buffer_check_valid(&text_buffer); SDL_GL_SwapWindow(window); } |