Syntax highlighting and comment
This commit is contained in:
+6
-7
@@ -9,7 +9,7 @@
|
||||
#include "../include/lisp.h"
|
||||
#include "../include/lisp_lib.h"
|
||||
|
||||
extern struct editorConfig;
|
||||
struct editorConfig;
|
||||
|
||||
void registerBuiltin(char *key_sequence, LispCFunc f) {
|
||||
lisp_env_define(E.ctx.p->env, lisp_make_symbol(key_sequence, E.ctx),
|
||||
@@ -40,7 +40,7 @@ void initBuiltins() {
|
||||
}
|
||||
|
||||
void initEditor() {
|
||||
char *init_file_path = (char *)calloc(256, sizeof(char));
|
||||
E.init_file_path = (char *)calloc(256, sizeof(char));
|
||||
E.cursor_x = 0;
|
||||
E.cursor_y = 0;
|
||||
E.rx = 0;
|
||||
@@ -67,10 +67,10 @@ void initEditor() {
|
||||
|
||||
E.prefix_state = 0;
|
||||
|
||||
strcat(init_file_path, getenv("HOME"));
|
||||
strcat(init_file_path, "/.beluga/config/init.lisp");
|
||||
printf("%s\n", init_file_path);
|
||||
E.fd_init_file = fopen(init_file_path, "r");
|
||||
strcat(E.init_file_path, getenv("HOME"));
|
||||
strcat(E.init_file_path, "/.beluga/config/init.lisp");
|
||||
// printf("%s\n", init_file_path);
|
||||
E.fd_init_file = fopen(E.init_file_path, "r");
|
||||
E.ctx = lisp_init();
|
||||
E.env = lisp_env(E.ctx);
|
||||
lisp_lib_load(E.ctx);
|
||||
@@ -79,7 +79,6 @@ void initEditor() {
|
||||
|
||||
// Read config file
|
||||
E.ctx_data = lisp_read_file(E.fd_init_file, &E.ctx_error, E.ctx);
|
||||
free(init_file_path);
|
||||
if (E.ctx_error != LISP_ERROR_NONE) {
|
||||
die("init failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user