summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-12-16 00:25:35 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-12-16 00:25:35 -0500
commita5a0a5561eaab9d17cc42e491b292a33f74cde21 (patch)
tree74aecfa69abbf7817b08c685928b83422ffbff33 /main.c
parent04a85e2c801a4610c80240e5a993f49039cd954f (diff)
fixed problem with adding lines; delete key
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);
}