|
|
@@ -249,6 +249,24 @@ void TuiEditor::render_window(std::shared_ptr<Window> window, int x, int y, int
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // Show cursor if this is the cursor line and this is the active window
|
|
|
+ if (buffer_line_idx == cursor.line && is_active && cursor_visible_) {
|
|
|
+ int cursor_screen_x = x + line_number_width + cursor.column;
|
|
|
+ if (cursor_screen_x < x + width) {
|
|
|
+ char cursor_char = ' ';
|
|
|
+ if (cursor.column < line_text.size()) {
|
|
|
+ cursor_char = line_text[cursor.column];
|
|
|
+ }
|
|
|
+
|
|
|
+ // Force A_REVERSE to ensure visible block cursor
|
|
|
+ int attrs = A_REVERSE;
|
|
|
+
|
|
|
+ attron(attrs);
|
|
|
+ mvaddch(y + screen_y, cursor_screen_x, cursor_char);
|
|
|
+ attroff(attrs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Track hardware cursor position for active window
|
|
|
if (buffer_line_idx == cursor.line && is_active) {
|
|
|
int cursor_screen_x = x + line_number_width + (int)cursor.column;
|