This commit is contained in:
@@ -68,6 +68,7 @@ struct editorConfig {
|
||||
|
||||
struct keyBind_t* key_binds;
|
||||
int number_of_keybinds;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -82,4 +83,5 @@ struct abuf {
|
||||
|
||||
extern struct editorConfig E;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef INIT_H_
|
||||
#define INIT_H_
|
||||
|
||||
#include "builtins.h"
|
||||
#include "data.h"
|
||||
#include "terminal.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "define.h"
|
||||
#include "output.h"
|
||||
#include "terminal.h"
|
||||
#include "builtins.h"
|
||||
#include <unistd.h>
|
||||
|
||||
// KEYS keycode
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
* interactions. \version 0.1 \date 21 septembre 2024
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define _DEFAULT_SOURCE
|
||||
#define _BSD_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
@@ -32,6 +33,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
editorSetStatusMessage("HELP: Ctrl-S = save | Ctrl-Q = quit");
|
||||
|
||||
|
||||
while (1) {
|
||||
editorRefreshScreen();
|
||||
editorProcessKeypress();
|
||||
|
||||
+1
-1
@@ -49,7 +49,6 @@ void editorCloseFile(void) {
|
||||
E.filename = NULL;
|
||||
E.status_msg[0] = '\0';
|
||||
E.status_msg_time = 0;
|
||||
|
||||
}
|
||||
|
||||
void editorOpen(char *filename) {
|
||||
@@ -58,6 +57,7 @@ void editorOpen(char *filename) {
|
||||
// Test if a file is already open
|
||||
if (E.filename != NULL) {
|
||||
editorCloseFile();
|
||||
E.state = READ_AND_WRITE;
|
||||
}
|
||||
|
||||
free(E.filename);
|
||||
|
||||
Reference in New Issue
Block a user