Cleanup
This commit is contained in:
31
Makefile
31
Makefile
@@ -13,21 +13,22 @@ CCACHE := ccache
|
||||
CXX_DEBUG := $(CCACHE) g++
|
||||
CXX_RELEASE := $(CCACHE) clang++
|
||||
|
||||
CFLAGS_DEBUG := -std=c++20 -Wall -Wextra \
|
||||
-O0 -fno-inline -gsplit-dwarf\
|
||||
-g -fsanitize=address -fno-omit-frame-pointer\
|
||||
-Wno-unused-command-line-argument \
|
||||
-I./include -I./libs
|
||||
CFLAGS_RELEASE := -std=c++20 -O3 -march=native \
|
||||
-fno-exceptions -fno-rtti -fstrict-aliasing \
|
||||
-ffast-math \
|
||||
-fvisibility=hidden -fuse-ld=lld \
|
||||
-flto=thin -Wl,--thinlto-cache-dir=.thinlto-cache \
|
||||
-fomit-frame-pointer -DNDEBUG -s \
|
||||
-mllvm -vectorize-loops \
|
||||
-fno-unwind-tables -fno-asynchronous-unwind-tables\
|
||||
-Wno-unused-command-line-argument \
|
||||
-I./include -I./libs
|
||||
CFLAGS_DEBUG :=\
|
||||
-std=c++20 -Wall -Wextra \
|
||||
-O0 -fno-inline -gsplit-dwarf\
|
||||
-g -fsanitize=address -fno-omit-frame-pointer\
|
||||
-Wno-unused-command-line-argument \
|
||||
-I./include -I./libs
|
||||
CFLAGS_RELEASE := \
|
||||
-std=c++20 -O3 -march=native \
|
||||
-fno-exceptions -fno-rtti -fstrict-aliasing \
|
||||
-ffast-math -flto=thin \
|
||||
-fvisibility=hidden -fuse-ld=lld \
|
||||
-fomit-frame-pointer -DNDEBUG -s \
|
||||
-mllvm -vectorize-loops \
|
||||
-fno-unwind-tables -fno-asynchronous-unwind-tables\
|
||||
-Wno-unused-command-line-argument \
|
||||
-I./include -I./libs
|
||||
|
||||
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
|
||||
PCH_CFLAGS_RELEASE := $(CFLAGS_RELEASE) -x c++-header
|
||||
|
||||
@@ -7,6 +7,7 @@ A TUI IDE.
|
||||
# TODO
|
||||
|
||||
- [ ] Add status bar & RUNNER mode
|
||||
- [ ] Maybe hide boxes in !`normal` mode
|
||||
- [ ] Fix indentation logic
|
||||
- [ ] 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
|
||||
@@ -41,6 +42,8 @@ A TUI IDE.
|
||||
- [ ] Add support for virtual cursor where edits apply at all the places.
|
||||
- [ ] Add alt + click to set multiple cursors.
|
||||
- [ ] 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 splash screen / minigame jumping.
|
||||
- [ ] Normalize / validate unicode on file open. so use utf8 purely and fix other types of files
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef EDITOR_H
|
||||
#define EDITOR_H
|
||||
|
||||
#include "boxes/diagnostics.h"
|
||||
#include "boxes/hover.h"
|
||||
#include "ui/diagnostics.h"
|
||||
#include "ui/hover.h"
|
||||
#include "editor/spans.h"
|
||||
#include "io/knot.h"
|
||||
#include "io/ui.h"
|
||||
#include "io/sysio.h"
|
||||
#include "ts/decl.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
|
||||
@@ -83,6 +83,10 @@ extern std::vector<ScreenCell> screen;
|
||||
extern std::vector<ScreenCell> old_screen;
|
||||
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();
|
||||
void end_screen();
|
||||
void update(uint32_t row, uint32_t col, std::string utf8, uint32_t fg,
|
||||
6
include/ui/bar.h
Normal file
6
include/ui/bar.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef UI_BAR_H
|
||||
#define UI_BAR_H
|
||||
|
||||
#include "utils/utils.h"
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef BOXES_DIAGNOSTICS_H
|
||||
#define BOXES_DIAGNOSTICS_H
|
||||
#ifndef UI_DIAGNOSTICS_H
|
||||
#define UI_DIAGNOSTICS_H
|
||||
|
||||
#include "editor/decl.h"
|
||||
#include "io/ui.h"
|
||||
#include "io/sysio.h"
|
||||
#include "pch.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef BOXES_HOVER_H
|
||||
#define BOXES_HOVER_H
|
||||
#ifndef UI_HOVER_H
|
||||
#define UI_HOVER_H
|
||||
|
||||
#include "editor/decl.h"
|
||||
#include "io/ui.h"
|
||||
#include "io/sysio.h"
|
||||
#include "pch.h"
|
||||
#include "ts/decl.h"
|
||||
#include "utils/utils.h"
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "io/ui.h"
|
||||
#include "io/sysio.h"
|
||||
|
||||
static Queue<char> input_queue;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "io/ui.h"
|
||||
#include "io/sysio.h"
|
||||
|
||||
uint32_t rows, cols;
|
||||
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;
|
||||
}
|
||||
|
||||
inline bool is_empty_cell(const ScreenCell &c) {
|
||||
return c.utf8.empty() || c.utf8 == " " || c.utf8 == "\x1b";
|
||||
}
|
||||
|
||||
void render() {
|
||||
static bool first_render = true;
|
||||
uint32_t current_fg = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "main.h"
|
||||
#include "editor/editor.h"
|
||||
#include "io/ui.h"
|
||||
#include "io/sysio.h"
|
||||
#include "lsp/lsp.h"
|
||||
#include "ts/ts.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "config.h"
|
||||
#include "io/ui.h"
|
||||
#include "io/sysio.h"
|
||||
#include "ts/ts.h"
|
||||
|
||||
std::unordered_map<std::string, pcre2_code *> regex_cache;
|
||||
|
||||
1
src/ui/bar.cc
Normal file
1
src/ui/bar.cc
Normal file
@@ -0,0 +1 @@
|
||||
#include "ui/bar.h"
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "boxes/diagnostics.h"
|
||||
#include "ui/diagnostics.h"
|
||||
|
||||
void DiagnosticBox::clear() {
|
||||
warnings.clear();
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "boxes/hover.h"
|
||||
#include "ui/hover.h"
|
||||
#include "ts/ts.h"
|
||||
|
||||
void HoverBox::clear() {
|
||||
Reference in New Issue
Block a user