summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-23 18:57:41 -0500
committerpommicket <pommicket@gmail.com>2022-12-23 18:57:41 -0500
commiteb7519e92f768224803ab66985541c99bddc2bf0 (patch)
tree53a414205020cad9e8fcd2d8436e30cfae872a6e /main.c
parent431a785f20127a7f1b6c1a6f1cd2a5031a7236ca (diff)
scroll through completions
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.c b/main.c
index f7d91a3..82840b8 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,5 @@
/*
@TODO:
-- scroll through completions
- LSP setting
- figure out workspace
- make sure "save as" works
@@ -723,8 +722,13 @@ int main(int argc, char **argv) {
case SDL_MOUSEWHEEL: {
// scroll with mouse wheel
Sint32 dx = event.wheel.x, dy = -event.wheel.y;
- ted->scroll_total_x += dx;
- ted->scroll_total_y += dy;
+ Autocomplete *ac = &ted->autocomplete;
+ if (ac->open && rect_contains_point(ac->rect, ted->mouse_pos)) {
+ autocomplete_scroll(ted, dy);
+ } else {
+ ted->scroll_total_x += dx;
+ ted->scroll_total_y += dy;
+ }
} break;
case SDL_MOUSEBUTTONDOWN: {
Uint32 button = event.button.button;