Fix bar dead code

This commit is contained in:
2026-02-01 20:47:41 +00:00
parent 8b93b955e8
commit 59fe554259
4 changed files with 7 additions and 23 deletions

View File

@@ -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
- 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
- Or revert to cruby and retry with manual linking . maybe it might work?
* add command to set and use a file type at runtime
* [ ] color alpha in ini files
* [ ] Make warning before ctrl+q for saving
@@ -29,11 +28,11 @@ Copyright 2025 Syed Daanish
* [ ] Ignore comments/strings from parser when auto-indenting.
* [ ] **Readme:** Update readme to show ruby based config in detail.
* [ ] **UI Refinement:**
* [ ] Allow completion list to be scrolled; show only `x` max items.
* [ ] Finish autocomplete box style functions.
* [ ] **Documentation UI:** Capture `Ctrl+h` / `Ctrl+l` for scrolling documentation windows.
* [ ] Redo hooks as a struct.
* [ ] 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
* 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
* [ ] **Editor word highlighter:** Do not recompute word under cursor if not changed.
* [ ] **Completion Filtering:**
* [ ] Stop filtering case-sensitive.
* [ ] 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?
* [ ] **Status Bar:** Complete status bar and command runner.
* [ ] Add color picker/palette.
* [ ] **Git:** Add Git integration (status, diffs).

View File

@@ -10,11 +10,8 @@ struct Bar {
std::string command = "";
std::string log_line = "";
uint32_t cursor = 0;
BarLine bar_line;
std::mutex mtx;
void init(Coord screen) { this->screen = screen; }
void work();
void render();
void handle(KeyEvent event);
void log(std::string message);

View File

@@ -91,7 +91,6 @@ int main(int argc, char *argv[]) {
free(event.c);
render:
throttle(4ms, editor_worker, editors[current_editor]);
bar.work();
bar.render();
render_editor(editors[current_editor]);
throttle(4ms, render);

View File

@@ -4,24 +4,16 @@
#include "main.h"
#include "syntax/decl.h"
void Bar::work() {
std::lock_guard<std::mutex> lock(mtx);
void Bar::log(std::string message) { log_line = message; }
void Bar::render() {
USING(LSPInstance);
Editor *editor = editors[current_editor];
bar_line =
BarLine bar_line =
bar_contents(mode, editor->lang.name, editor->warnings.size(),
editor->lsp ? editor->lsp->lsp->command : "",
editor->filename, editor->filename, editor->cursor.row + 1,
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 width = screen.col;
std::string &line = bar_line.line;
@@ -59,6 +51,7 @@ void Bar::render() {
void Bar::handle(KeyEvent event) {
if (event.key_type == KEY_CHAR && event.len == 1) {
if (event.c[0] == 0x1B) {
command = "";
mode = NORMAL;
} else if (event.c[0] == '\n' || event.c[0] == '\r') {
command = trim(command);