summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--window.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/window.c b/window.c
index 9d10f85..1c300b7 100644
--- a/window.c
+++ b/window.c
@@ -105,6 +105,16 @@ void window_redraw(struct editor_state *editor)
draw_font_text(&buffer);
+ SDL_Rect cursor_rect;
+ cursor_rect.x = editor->cursor_display_x * font.width;
+ cursor_rect.y = (editor->cursor_y - editor->row_offset) * font.height;
+ cursor_rect.w = font.width;
+ cursor_rect.h = font.height;
+
+ SDL_SetRenderDrawColor(renderer, 0x7f, 0x7f, 0x7f, 0xff);
+ SDL_RenderFillRect(renderer, &cursor_rect);
+ SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xff);
+
SDL_RenderPresent(renderer);
SDL_UpdateWindowSurface(window);
}