Adding splitting screen and buffer switching
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user