summaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-04 20:52:10 -0400
committerpommicket <pommicket@gmail.com>2023-08-04 20:52:10 -0400
commitce199f9384f9f9376417110574a07cfd731e3a79 (patch)
treed87a14a789eea521252447cd6dd477295e5612b9 /buffer.c
parent4cdbd1c8caf7fbd9ed584049312241a0e039e115 (diff)
use dynamic arrays for mouse_clicks/mouse_releases
simplifies code
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/buffer.c b/buffer.c
index df9f7f6..39bc1dd 100644
--- a/buffer.c
+++ b/buffer.c
@@ -3014,8 +3014,8 @@ void buffer_render(TextBuffer *buffer, Rect r) {
if (buffer->is_line_buffer) {
// handle clicks
// this is only done for line buffers, so that ctrl+click works properly (and happens in one frame).
- for (u32 i = 0; i < ted->nmouse_clicks[SDL_BUTTON_LEFT]; ++i) {
- buffer_handle_click(ted, buffer, ted->mouse_clicks[SDL_BUTTON_LEFT][i], ted->mouse_click_times[SDL_BUTTON_LEFT][i]);
+ arr_foreach_ptr(ted->mouse_clicks[SDL_BUTTON_LEFT], MouseClick, click) {
+ buffer_handle_click(ted, buffer, click->pos, click->times);
}
}