summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-05 15:01:38 -0400
committerpommicket <pommicket@gmail.com>2023-08-05 15:01:38 -0400
commitb65943698a241624973f3ab54530bb5d5884cff2 (patch)
tree07b519ae1a9f601894935ddfba2f968656302dd8 /main.c
parent0f38b14e10f553cb49a5da65125e21e1591cba3e (diff)
internalize Autocomplete
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 8bc1ec5..ec8af1e 100644
--- a/main.c
+++ b/main.c
@@ -500,6 +500,7 @@ int main(int argc, char **argv) {
gl_geometry_init();
text_init();
+ autocomplete_init(ted);
PROFILE_TIME(gl_end)
@@ -633,8 +634,7 @@ int main(int argc, char **argv) {
} else if (key_modifier == 0) {
// scroll with mouse wheel
Sint32 dx = event.wheel.x, dy = -event.wheel.y;
- Autocomplete *ac = &ted->autocomplete;
- if (ac->open && rect_contains_point(ac->rect, ted->mouse_pos)) {
+ if (autocomplete_box_contains_point(ted, ted->mouse_pos)) {
autocomplete_scroll(ted, dy);
} else {
ted->scroll_total_x += dx;