Adding splitting screen and buffer switching

This commit is contained in:
Arthur Barraux
2026-01-24 19:29:46 +01:00
parent b039cf3ded
commit 5a7b073041
22 changed files with 1171 additions and 384 deletions
+8 -5
View File
@@ -5,6 +5,8 @@
* interactions. \version 0.1 \date 21 septembre 2024
*/
#include "include/buffer.h"
#include "include/split_screen.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -30,17 +32,18 @@ int main(int argc, char *argv[]) {
enableRawMode();
initEditor();
if (argc >= 2) {
E.state = READ_AND_WRITE;
editorOpen(argv[1]);
EditorPane *active = splitScreenGetActivePane();
active->buffer_id = bufferCreate(argv[1]);
} else {
strcat(splash_screen, getenv("HOME"));
strcat(splash_screen, "/.beluga/assets/beluga.txt");
fprintf(stderr, "%s\n", splash_screen);
editorOpen(splash_screen);
EditorPane *active = splitScreenGetActivePane();
active->buffer_id = bufferCreate(splash_screen);
}
free(splash_screen);
//free(splash_screen);
editorSetStatusMessage("HELP: Ctrl-x Ctrl-s = save | Ctrl-x Ctrl-q = quit");
editorSetStatusMessage("HELP: Ctrl-x Ctrl-s = save | Ctrl-x Ctrl-c = quit");
while (1) {