diff options
author | cflip <cflip@cflip.net> | 2023-01-08 14:15:01 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-08 14:15:01 -0700 |
commit | 91195d34e1f71246cadc41705004d66ab647087e (patch) | |
tree | 0d2f7e929b7b51590d270e2f22fb5a3621204bf2 /main.c |
Initial import of existing source code
This is based off of snaptoken's "Build Your Own Text Editor" tutorial
at https://viewsourcecode.org/snaptoken/kilo/.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#include "input.h" +#include "file.h" +#include "editor.h" +#include "terminal.h" + +int main(int argc, char** argv) +{ + enable_raw_mode(); + + struct editor_state editor; + init_editor(&editor); + + if (argc >= 2) { + editor_open(&editor, argv[1]); + } + + 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); + } + + return 0; +} |