summaryrefslogtreecommitdiff
path: root/ted.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-25 21:55:42 -0500
committerpommicket <pommicket@gmail.com>2022-12-25 21:55:42 -0500
commit9602ae4d8582c3ccdb9e8c1561ad306491713be4 (patch)
treef3f02a332daa19ace69dbc9c0a9a63be85a41ad9 /ted.c
parent4bd6bbe54b291d8d65997e998a2a3946293adcdf (diff)
global lsp-enabled setting
Diffstat (limited to 'ted.c')
-rw-r--r--ted.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ted.c b/ted.c
index 0a71227..637a592 100644
--- a/ted.c
+++ b/ted.c
@@ -92,6 +92,10 @@ Settings *ted_get_settings(Ted *ted, const char *path, Language language) {
}
LSP *ted_get_lsp(Ted *ted, const char *path, Language language) {
+ Settings *settings = ted_get_settings(ted, path, language);
+ if (!settings->lsp_enabled)
+ return NULL;
+
int i;
for (i = 0; i < TED_LSP_MAX; ++i) {
LSP *lsp = ted->lsps[i];
@@ -105,7 +109,6 @@ LSP *ted_get_lsp(Ted *ted, const char *path, Language language) {
}
if (i == TED_LSP_MAX)
return NULL; // why are there so many LSP open???
- Settings *settings = ted_get_settings(ted, path, language);
if (*settings->lsp) {
// start up this LSP
char *root_dir = settings_get_root_dir(settings, path);