Made Editor Config global

This commit is contained in:
Arthur Barraux
2025-09-19 14:31:12 +02:00
parent 91e247d1de
commit 8ce621dfde
17 changed files with 235 additions and 215 deletions
+8 -8
View File
@@ -16,21 +16,21 @@
#include "include/output.h"
#include "include/terminal.h"
struct editorConfig E;
int main(int argc, char *argv[]) {
struct editorConfig E;
enableRawMode(&E);
initEditor(&E);
enableRawMode();
initEditor();
if (argc >= 2) {
editorOpen(&E, argv[1]);
editorOpen(argv[1]);
}
editorSetStatusMessage(&E, "HELP: Ctrl-S = save | Ctrl-Q = quit");
editorSetStatusMessage("HELP: Ctrl-S = save | Ctrl-Q = quit");
while (1) {
editorRefreshScreen(&E);
editorProcessKeypress(&E);
editorRefreshScreen();
editorProcessKeypress();
}
return 0;
}