diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 14:30:27 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 14:30:27 -0500 |
commit | 6d77e94b652ab4b8070b5acf1c6febfe77fc41c3 (patch) | |
tree | 371459fb5c1eb323959c365f8b39fe5a53631681 /buffer.c | |
parent | 047764ebab345a2bcb3a856c1f1956e849f52354 (diff) |
change cursor
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2072,7 +2072,7 @@ void buffer_render(TextBuffer *buffer, Rect r) { rect_coords(r, &x1, &y1, &x2, &y2); // Correct the scroll, because the window size might have changed buffer_correct_scroll(buffer); - + Font *font = buffer_font(buffer); u32 nlines = buffer->nlines; Line *lines = buffer->lines; @@ -2123,6 +2123,11 @@ void buffer_render(TextBuffer *buffer, Rect r) { buffer->x1 = x1; buffer->y1 = y1; buffer->x2 = x2; buffer->y2 = y2; + // change cursor to ibeam when it's hovering over the buffer + if ((!ted->menu || buffer == &ted->line_buffer) && rect_contains_point(rect4(x1, y1, x2, y2), ted->mouse_pos)) { + ted->cursor = ted->cursor_ibeam; + } + if (buffer->center_cursor_next_frame) { buffer_center_cursor(buffer); |