Skip to content

Commit

Permalink
Don't request server launch on hover
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed Jun 1, 2024
1 parent 9802fb6 commit a44cb99
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lsp/src/lsp-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,9 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *obj, GeanyEditor *editor

if (nt->nmhdr.code == SCN_DWELLSTART)
{
LspServer *srv = lsp_server_get(doc);
LspServer *srv = lsp_server_get_if_running(doc);
if (!srv)
return FALSE;

// also delivered when other window has focus
if (!gtk_widget_has_focus(GTK_WIDGET(sci)))
Expand All @@ -811,9 +813,6 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *obj, GeanyEditor *editor
if (nt->position < 0 || nt->y == 0)
return FALSE;

if (!srv)
return FALSE;

if (lsp_signature_showing_calltip(doc))
; /* don't cancel signature calltips by accidental hovers */
else if (srv->config.diagnostics_enable && lsp_diagnostics_has_diag(nt->position))
Expand All @@ -825,7 +824,7 @@ static gboolean on_editor_notify(G_GNUC_UNUSED GObject *obj, GeanyEditor *editor
}
else if (nt->nmhdr.code == SCN_DWELLEND)
{
LspServer *srv = lsp_server_get(doc);
LspServer *srv = lsp_server_get_if_running(doc);
if (!srv)
return FALSE;

Expand Down

0 comments on commit a44cb99

Please sign in to comment.