This commit is contained in:
2025-12-30 15:22:09 +00:00
parent dc507dfc23
commit 0390a1bc5d
14 changed files with 45 additions and 34 deletions

View File

@@ -13,21 +13,22 @@ CCACHE := ccache
CXX_DEBUG := $(CCACHE) g++ CXX_DEBUG := $(CCACHE) g++
CXX_RELEASE := $(CCACHE) clang++ CXX_RELEASE := $(CCACHE) clang++
CFLAGS_DEBUG := -std=c++20 -Wall -Wextra \ CFLAGS_DEBUG :=\
-O0 -fno-inline -gsplit-dwarf\ -std=c++20 -Wall -Wextra \
-g -fsanitize=address -fno-omit-frame-pointer\ -O0 -fno-inline -gsplit-dwarf\
-Wno-unused-command-line-argument \ -g -fsanitize=address -fno-omit-frame-pointer\
-I./include -I./libs -Wno-unused-command-line-argument \
CFLAGS_RELEASE := -std=c++20 -O3 -march=native \ -I./include -I./libs
-fno-exceptions -fno-rtti -fstrict-aliasing \ CFLAGS_RELEASE := \
-ffast-math \ -std=c++20 -O3 -march=native \
-fvisibility=hidden -fuse-ld=lld \ -fno-exceptions -fno-rtti -fstrict-aliasing \
-flto=thin -Wl,--thinlto-cache-dir=.thinlto-cache \ -ffast-math -flto=thin \
-fomit-frame-pointer -DNDEBUG -s \ -fvisibility=hidden -fuse-ld=lld \
-mllvm -vectorize-loops \ -fomit-frame-pointer -DNDEBUG -s \
-fno-unwind-tables -fno-asynchronous-unwind-tables\ -mllvm -vectorize-loops \
-Wno-unused-command-line-argument \ -fno-unwind-tables -fno-asynchronous-unwind-tables\
-I./include -I./libs -Wno-unused-command-line-argument \
-I./include -I./libs
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header

View File

@@ -7,6 +7,7 @@ A TUI IDE.
# TODO # TODO
- [ ] Add status bar & RUNNER mode - [ ] Add status bar & RUNNER mode
- [ ] Maybe hide boxes in !`normal` mode
- [ ] Fix indentation logic - [ ] Fix indentation logic
- [ ] Fix bug where closing immediately while lsp is loading hangs and then segfaults. - [ ] Fix bug where closing immediately while lsp is loading hangs and then segfaults.
- [ ] For `"insertTextFormat": 2` in `clangd` and similar use only the last word in the signature when replacing - [ ] For `"insertTextFormat": 2` in `clangd` and similar use only the last word in the signature when replacing
@@ -41,6 +42,8 @@ A TUI IDE.
- [ ] Add support for virtual cursor where edits apply at all the places. - [ ] Add support for virtual cursor where edits apply at all the places.
- [ ] Add alt + click to set multiple cursors. - [ ] Add alt + click to set multiple cursors.
- [ ] Add search / replace along with search / virtual cursors are searched pos. - [ ] Add search / replace along with search / virtual cursors are searched pos.
- Allow using perl directly for replace maybe? and others with my dfa?
- or add searcher that supports $1 $2 etc. (capture groups)
- [ ] Add support for undo/redo. - [ ] Add support for undo/redo.
- [ ] Add splash screen / minigame jumping. - [ ] Add splash screen / minigame jumping.
- [ ] Normalize / validate unicode on file open. so use utf8 purely and fix other types of files - [ ] Normalize / validate unicode on file open. so use utf8 purely and fix other types of files

View File

@@ -1,11 +1,11 @@
#ifndef EDITOR_H #ifndef EDITOR_H
#define EDITOR_H #define EDITOR_H
#include "boxes/diagnostics.h" #include "ui/diagnostics.h"
#include "boxes/hover.h" #include "ui/hover.h"
#include "editor/spans.h" #include "editor/spans.h"
#include "io/knot.h" #include "io/knot.h"
#include "io/ui.h" #include "io/sysio.h"
#include "ts/decl.h" #include "ts/decl.h"
#include "utils/utils.h" #include "utils/utils.h"

View File

@@ -83,6 +83,10 @@ extern std::vector<ScreenCell> screen;
extern std::vector<ScreenCell> old_screen; extern std::vector<ScreenCell> old_screen;
extern std::mutex screen_mutex; extern std::mutex screen_mutex;
inline bool is_empty_cell(const ScreenCell &c) {
return c.utf8.empty() || c.utf8 == " " || c.utf8 == "\x1b";
}
Coord start_screen(); Coord start_screen();
void end_screen(); void end_screen();
void update(uint32_t row, uint32_t col, std::string utf8, uint32_t fg, void update(uint32_t row, uint32_t col, std::string utf8, uint32_t fg,

6
include/ui/bar.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef UI_BAR_H
#define UI_BAR_H
#include "utils/utils.h"
#endif

View File

@@ -1,8 +1,8 @@
#ifndef BOXES_DIAGNOSTICS_H #ifndef UI_DIAGNOSTICS_H
#define BOXES_DIAGNOSTICS_H #define UI_DIAGNOSTICS_H
#include "editor/decl.h" #include "editor/decl.h"
#include "io/ui.h" #include "io/sysio.h"
#include "pch.h" #include "pch.h"
#include "utils/utils.h" #include "utils/utils.h"

View File

@@ -1,8 +1,8 @@
#ifndef BOXES_HOVER_H #ifndef UI_HOVER_H
#define BOXES_HOVER_H #define UI_HOVER_H
#include "editor/decl.h" #include "editor/decl.h"
#include "io/ui.h" #include "io/sysio.h"
#include "pch.h" #include "pch.h"
#include "ts/decl.h" #include "ts/decl.h"
#include "utils/utils.h" #include "utils/utils.h"

View File

@@ -1,4 +1,4 @@
#include "io/ui.h" #include "io/sysio.h"
static Queue<char> input_queue; static Queue<char> input_queue;

View File

@@ -1,4 +1,4 @@
#include "io/ui.h" #include "io/sysio.h"
uint32_t rows, cols; uint32_t rows, cols;
bool show_cursor = 0; bool show_cursor = 0;
@@ -112,10 +112,6 @@ void update(uint32_t row, uint32_t col, const char *utf8, uint32_t fg,
screen[idx].ul_color = ul_color; screen[idx].ul_color = ul_color;
} }
inline bool is_empty_cell(const ScreenCell &c) {
return c.utf8.empty() || c.utf8 == " " || c.utf8 == "\x1b";
}
void render() { void render() {
static bool first_render = true; static bool first_render = true;
uint32_t current_fg = 0; uint32_t current_fg = 0;

View File

@@ -1,6 +1,6 @@
#include "main.h" #include "main.h"
#include "editor/editor.h" #include "editor/editor.h"
#include "io/ui.h" #include "io/sysio.h"
#include "lsp/lsp.h" #include "lsp/lsp.h"
#include "ts/ts.h" #include "ts/ts.h"

View File

@@ -1,5 +1,5 @@
#include "config.h" #include "config.h"
#include "io/ui.h" #include "io/sysio.h"
#include "ts/ts.h" #include "ts/ts.h"
std::unordered_map<std::string, pcre2_code *> regex_cache; std::unordered_map<std::string, pcre2_code *> regex_cache;

1
src/ui/bar.cc Normal file
View File

@@ -0,0 +1 @@
#include "ui/bar.h"

View File

@@ -1,4 +1,4 @@
#include "boxes/diagnostics.h" #include "ui/diagnostics.h"
void DiagnosticBox::clear() { void DiagnosticBox::clear() {
warnings.clear(); warnings.clear();

View File

@@ -1,4 +1,4 @@
#include "boxes/hover.h" #include "ui/hover.h"
#include "ts/ts.h" #include "ts/ts.h"
void HoverBox::clear() { void HoverBox::clear() {