Fix bar dead code
This commit is contained in:
7
TODO.md
7
TODO.md
@@ -19,7 +19,6 @@ Copyright 2025 Syed Daanish
|
|||||||
- So one lsp being slower wont affect others and fps based reading wont be necessary saving cpu
|
- So one lsp being slower wont affect others and fps based reading wont be necessary saving cpu
|
||||||
- At which point the main thread can also be blocked on user input or lsp responses and still be fast
|
- At which point the main thread can also be blocked on user input or lsp responses and still be fast
|
||||||
* [ ] Add mgems for most common things and a ruby library to allow combining true ruby with mruby
|
* [ ] Add mgems for most common things and a ruby library to allow combining true ruby with mruby
|
||||||
- Or revert to cruby and retry with manual linking . maybe it might work?
|
|
||||||
* add command to set and use a file type at runtime
|
* add command to set and use a file type at runtime
|
||||||
* [ ] color alpha in ini files
|
* [ ] color alpha in ini files
|
||||||
* [ ] Make warning before ctrl+q for saving
|
* [ ] Make warning before ctrl+q for saving
|
||||||
@@ -29,11 +28,11 @@ Copyright 2025 Syed Daanish
|
|||||||
* [ ] Ignore comments/strings from parser when auto-indenting.
|
* [ ] Ignore comments/strings from parser when auto-indenting.
|
||||||
* [ ] **Readme:** Update readme to show ruby based config in detail.
|
* [ ] **Readme:** Update readme to show ruby based config in detail.
|
||||||
* [ ] **UI Refinement:**
|
* [ ] **UI Refinement:**
|
||||||
* [ ] Allow completion list to be scrolled; show only `x` max items.
|
|
||||||
* [ ] Finish autocomplete box style functions.
|
* [ ] Finish autocomplete box style functions.
|
||||||
* [ ] **Documentation UI:** Capture `Ctrl+h` / `Ctrl+l` for scrolling documentation windows.
|
* [ ] **Documentation UI:** Capture `Ctrl+h` / `Ctrl+l` for scrolling documentation windows.
|
||||||
* [ ] Redo hooks as a struct.
|
* [ ] Redo hooks as a struct.
|
||||||
* [ ] breakdown the render function into smaller functions.
|
* [ ] breakdown the render function into smaller functions.
|
||||||
|
- Might allow for VAI integration easier
|
||||||
|
|
||||||
* Try to make all functions better now that folds have been purged
|
* Try to make all functions better now that folds have been purged
|
||||||
* Cleanup syntax and renderer files
|
* Cleanup syntax and renderer files
|
||||||
@@ -87,8 +86,6 @@ move lsp configs to json and also allow configs for windows-style vs unix-style
|
|||||||
|
|
||||||
### UX
|
### UX
|
||||||
|
|
||||||
* [ ] **Editor word highlighter:** Do not recompute word under cursor if not changed.
|
|
||||||
|
|
||||||
* [ ] **Completion Filtering:**
|
* [ ] **Completion Filtering:**
|
||||||
* [ ] Stop filtering case-sensitive.
|
* [ ] Stop filtering case-sensitive.
|
||||||
* [ ] Normalize completion edits if local filtering is used.
|
* [ ] Normalize completion edits if local filtering is used.
|
||||||
@@ -118,8 +115,6 @@ move lsp configs to json and also allow configs for windows-style vs unix-style
|
|||||||
|
|
||||||
### Visuals, UI & Extensions?
|
### Visuals, UI & Extensions?
|
||||||
|
|
||||||
* [ ] **Status Bar:** Complete status bar and command runner.
|
|
||||||
|
|
||||||
* [ ] Add color picker/palette.
|
* [ ] Add color picker/palette.
|
||||||
|
|
||||||
* [ ] **Git:** Add Git integration (status, diffs).
|
* [ ] **Git:** Add Git integration (status, diffs).
|
||||||
|
|||||||
@@ -10,11 +10,8 @@ struct Bar {
|
|||||||
std::string command = "";
|
std::string command = "";
|
||||||
std::string log_line = "";
|
std::string log_line = "";
|
||||||
uint32_t cursor = 0;
|
uint32_t cursor = 0;
|
||||||
BarLine bar_line;
|
|
||||||
std::mutex mtx;
|
|
||||||
|
|
||||||
void init(Coord screen) { this->screen = screen; }
|
void init(Coord screen) { this->screen = screen; }
|
||||||
void work();
|
|
||||||
void render();
|
void render();
|
||||||
void handle(KeyEvent event);
|
void handle(KeyEvent event);
|
||||||
void log(std::string message);
|
void log(std::string message);
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ int main(int argc, char *argv[]) {
|
|||||||
free(event.c);
|
free(event.c);
|
||||||
render:
|
render:
|
||||||
throttle(4ms, editor_worker, editors[current_editor]);
|
throttle(4ms, editor_worker, editors[current_editor]);
|
||||||
bar.work();
|
|
||||||
bar.render();
|
bar.render();
|
||||||
render_editor(editors[current_editor]);
|
render_editor(editors[current_editor]);
|
||||||
throttle(4ms, render);
|
throttle(4ms, render);
|
||||||
|
|||||||
@@ -4,24 +4,16 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "syntax/decl.h"
|
#include "syntax/decl.h"
|
||||||
|
|
||||||
void Bar::work() {
|
void Bar::log(std::string message) { log_line = message; }
|
||||||
std::lock_guard<std::mutex> lock(mtx);
|
|
||||||
|
void Bar::render() {
|
||||||
|
USING(LSPInstance);
|
||||||
Editor *editor = editors[current_editor];
|
Editor *editor = editors[current_editor];
|
||||||
bar_line =
|
BarLine bar_line =
|
||||||
bar_contents(mode, editor->lang.name, editor->warnings.size(),
|
bar_contents(mode, editor->lang.name, editor->warnings.size(),
|
||||||
editor->lsp ? editor->lsp->lsp->command : "",
|
editor->lsp ? editor->lsp->lsp->command : "",
|
||||||
editor->filename, editor->filename, editor->cursor.row + 1,
|
editor->filename, editor->filename, editor->cursor.row + 1,
|
||||||
editor->root->line_count + 1, screen.col);
|
editor->root->line_count + 1, screen.col);
|
||||||
}
|
|
||||||
|
|
||||||
void Bar::log(std::string message) {
|
|
||||||
std::lock_guard<std::mutex> lock(mtx);
|
|
||||||
log_line = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bar::render() {
|
|
||||||
std::lock_guard<std::mutex> lock(mtx);
|
|
||||||
USING(LSPInstance);
|
|
||||||
uint32_t row = screen.row - 2;
|
uint32_t row = screen.row - 2;
|
||||||
uint32_t width = screen.col;
|
uint32_t width = screen.col;
|
||||||
std::string &line = bar_line.line;
|
std::string &line = bar_line.line;
|
||||||
@@ -59,6 +51,7 @@ void Bar::render() {
|
|||||||
void Bar::handle(KeyEvent event) {
|
void Bar::handle(KeyEvent event) {
|
||||||
if (event.key_type == KEY_CHAR && event.len == 1) {
|
if (event.key_type == KEY_CHAR && event.len == 1) {
|
||||||
if (event.c[0] == 0x1B) {
|
if (event.c[0] == 0x1B) {
|
||||||
|
command = "";
|
||||||
mode = NORMAL;
|
mode = NORMAL;
|
||||||
} else if (event.c[0] == '\n' || event.c[0] == '\r') {
|
} else if (event.c[0] == '\n' || event.c[0] == '\r') {
|
||||||
command = trim(command);
|
command = trim(command);
|
||||||
|
|||||||
Reference in New Issue
Block a user