summaryrefslogtreecommitdiff
path: root/ide-hover.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-07 13:01:09 -0500
committerpommicket <pommicket@gmail.com>2023-01-07 13:01:09 -0500
commit7640ecce499fc49cad3d9b9f391cce0b74e435c9 (patch)
treec0936d64de36d84d61be0e3f7cfa2f6bdaa42749 /ide-hover.c
parente2aad67eedd07cff24a51faf31b8c6984a23d777 (diff)
improve request cancellation, fix hover bug
Diffstat (limited to 'ide-hover.c')
-rw-r--r--ide-hover.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ide-hover.c b/ide-hover.c
index f99c2e7..2be04ca 100644
--- a/ide-hover.c
+++ b/ide-hover.c
@@ -46,7 +46,10 @@ void hover_process_lsp_response(Ted *ted, LSPResponse *response) {
TextBuffer *buffer=0;
LSPDocumentPosition pos={0};
LSP *lsp=0;
- get_hover_position(ted, &pos, &buffer, &lsp);
+ if (!get_hover_position(ted, &pos, &buffer, &lsp)) {
+ free(hover->text); hover->text = NULL;
+ return;
+ }
if (hover->text // we already have hover text
&& (