From 874d7d0c6555642b06c6d2c3e75c6eddf1c94bd0 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 3 Jan 2023 18:36:05 -0500 Subject: don't start up multiple LSP servers with the same command --- ted.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ted.c') diff --git a/ted.c b/ted.c index fdc3c4b..bbb83ee 100644 --- a/ted.c +++ b/ted.c @@ -170,7 +170,7 @@ LSP *ted_get_lsp(Ted *ted, const char *path, Language language) { for (i = 0; i < TED_LSP_MAX; ++i) { LSP *lsp = ted->lsps[i]; if (!lsp) break; - if (lsp->language != language) continue; + if (!streq(lsp->command, settings->lsp)) continue; if (!lsp->initialized) { // withhold judgement until this server initializes. @@ -190,7 +190,7 @@ LSP *ted_get_lsp(Ted *ted, const char *path, Language language) { if (*settings->lsp) { // start up this LSP char *root_dir = settings_get_root_dir(settings, path); - ted->lsps[i] = lsp_create(root_dir, language, settings->lsp); + ted->lsps[i] = lsp_create(root_dir, settings->lsp); free(root_dir); // don't actually return it yet, since it's still initializing (see above) } -- cgit v1.2.3