summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..1d17f79
--- /dev/null
+++ b/main.c
@@ -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;
+}