summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.c b/main.c
index 9bc9b13..d400f80 100644
--- a/main.c
+++ b/main.c
@@ -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);
}