From 38839408b1f65a825fd1f063a7b48279218950d5 Mon Sep 17 00:00:00 2001 From: Syed Daanish Date: Sat, 13 Dec 2025 01:05:06 +0000 Subject: [PATCH] idk --- README.md | 4 ++++ src/editor.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2dcc1d1..cf2f864 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ A TUI IDE. # TODO +- [ ] Fix problem highlighting selection when line is empty. +- [ ] Add ui api for setting cursor types. +- [ ] Use that api to set cursor for selection/insertion/normal etc properly. + - Sorta unrelated but check kutuwm + kitty problem not keeping cursor mode properly. - [ ] Add line numbers. - [ ] Add bg highlight for current line. - [ ] Make function to get selected text. (selection itself is done) diff --git a/src/editor.cc b/src/editor.cc index 93880c2..fed2c6f 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -327,7 +327,7 @@ void render_editor(Editor *editor) { cursor.col = editor->position.col + col; } if (editor->selection_active && - global_byte_offset + line_len + 1 >= sel_start && + global_byte_offset + line_len + 1 > sel_start && global_byte_offset + line_len + 1 <= sel_end && col < editor->size.col) { update(editor->position.row + rendered_rows, editor->position.col + col, @@ -350,7 +350,7 @@ void render_editor(Editor *editor) { } uint32_t col = 0; if (editor->selection_active && - global_byte_offset + line_len + 1 >= sel_start && + global_byte_offset + line_len + 1 > sel_start && global_byte_offset + line_len + 1 <= sel_end) { update(editor->position.row + rendered_rows, editor->position.col + col, " ", 0, 0x555555, 0);