diff options
author | pommicket <pommicket@gmail.com> | 2022-12-23 18:57:41 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2022-12-23 18:57:41 -0500 |
commit | eb7519e92f768224803ab66985541c99bddc2bf0 (patch) | |
tree | 53a414205020cad9e8fcd2d8436e30cfae872a6e /main.c | |
parent | 431a785f20127a7f1b6c1a6f1cd2a5031a7236ca (diff) |
scroll through completions
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; |