summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2023-01-08 21:25:21 -0700
committercflip <cflip@cflip.net>2023-01-08 21:25:21 -0700
commitc2e8836f592db9cf28111182ea40f1268c758933 (patch)
tree1dce79a44616787778a0223eb4e4dcfccf7f2e83 /main.c
parent76010f7b97e6b71db6e123d28c91f997ff56945c (diff)
Connect the window and font code to the editor's main function
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 7 insertions, 5 deletions
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;
}