From c2e8836f592db9cf28111182ea40f1268c758933 Mon Sep 17 00:00:00 2001 From: cflip Date: Sun, 8 Jan 2023 21:25:21 -0700 Subject: Connect the window and font code to the editor's main function --- main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 1d17f79..3718c41 100644 --- a/main.c +++ b/main.c @@ -1,11 +1,11 @@ #include "input.h" #include "file.h" #include "editor.h" -#include "terminal.h" +#include "window.h" int main(int argc, char** argv) { - enable_raw_mode(); + window_init(); struct editor_state editor; init_editor(&editor); @@ -16,10 +16,12 @@ int main(int argc, char** argv) editor_set_status_message(&editor, "HELP: Ctrl+Q = quit, Ctrl+S = save, Ctrl+F = find"); - while (1) { - editor_refresh_screen(&editor); - editor_process_keypress(&editor); + while (window_handle_event()) { + window_redraw(&editor); + // editor_refresh_screen(&editor); + // editor_process_keypress(&editor); } + window_destroy(); return 0; } -- cgit v1.2.3