popup and diagnose ui

This commit is contained in:
2026-06-02 13:00:13 +02:00
parent a8b2960eb4
commit 2738bc8042
25 changed files with 587 additions and 461 deletions
+17 -22
View File
@@ -9,6 +9,8 @@
#define _BSD_SOURCE
#define _GNU_SOURCE
#include <libgen.h>
#include "include/utils.h"
#include "include/buffer.h"
@@ -36,34 +38,27 @@ int main(int argc, char *argv[]) {
enableRawMode();
initEditor();
EditorPane *active = splitScreenGetActivePane();
struct buffer_t *buf;
strcat(splash_screen, getenv("HOME"));
strcat(splash_screen, "/.beluga/assets/beluga.txt");
appDebug("splash : %s\n", splash_screen);
active->buffer_id = bufferCreate(splash_screen, READ_ONLY);
if (argc >= 2) {
EditorPane *active = splitScreenGetActivePane();
active->buffer_id = bufferCreate(argv[1], READ_AND_WRITE);
char project_root[512];
realpath(argv[1], project_root);
char *slash = strrchr(project_root, '/');
if (slash) *slash = '\0';
buf = &E.buffers[active->buffer_id];
appDebug("peoject root : %s\n", project_root);
lspStart(E.lsp_client, project_root);
struct buffer_t *buf = &E.buffers[active->buffer_id];
lspDidOpen(E.lsp_client, buf);
} else {
strcat(splash_screen, getenv("HOME"));
strcat(splash_screen, "/.beluga/assets/beluga.txt");
appDebug("splash : %s\n", splash_screen);
EditorPane *active = splitScreenGetActivePane();
active->buffer_id = bufferCreate(splash_screen, READ_ONLY);
struct buffer_t *buf = &E.buffers[active->buffer_id];
lspStart(E.lsp_client, splash_screen);
lspDidOpen(E.lsp_client, buf);
appDebug("peoject root : %s\n", dirname(buf->fullname));
if (E.constantes.LSP) {
lspDidOpen(E.lsp_client, buf);
}
}
free(splash_screen);
bFree(splash_screen);
editorSetStatusMessage("HELP: Ctrl-x Ctrl-s = save | Ctrl-x Ctrl-c = quit");