summaryrefslogtreecommitdiff
path: root/ide-hover.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-31 15:48:12 -0500
committerpommicket <pommicket@gmail.com>2022-12-31 15:48:12 -0500
commitfd617d8d9723f76dcdb51b2fa54ef960be4edccc (patch)
treeaaf01cc5bda6703448b63ea0ea7ffff30f820bba /ide-hover.c
parent992315198b510e210a7791f21953bf0e27786108 (diff)
hover-time setting
Diffstat (limited to 'ide-hover.c')
-rw-r--r--ide-hover.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ide-hover.c b/ide-hover.c
index 9a7c0c9..1d6ccbc 100644
--- a/ide-hover.c
+++ b/ide-hover.c
@@ -79,13 +79,16 @@ void hover_frame(Ted *ted, double dt) {
bool shift_down = SDL_GetKeyboardState(NULL)[SDL_SCANCODE_LSHIFT]
|| SDL_GetKeyboardState(NULL)[SDL_SCANCODE_RSHIFT];
- if (!shift_down) {
+ bool open_hover = shift_down || hover->time >= settings->hover_time;
+
+ hover->time += dt;
+
+ if (!open_hover)
hover_close(ted);
- }
(void)dt;
if (!hover->open) {
- if (shift_down) {
+ if (open_hover) {
hover_send_request(ted);
hover->open = true;
}