From 5a7e33eb13e4f01138857154c6c504b46759a967 Mon Sep 17 00:00:00 2001 From: Quan Nguyen Date: Sun, 22 Sep 2024 08:52:19 +0900 Subject: [PATCH] Fix adding server multiple time (#531) --- autoload/lsp/lsp.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 507eb00f..24cf5895 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -91,6 +91,11 @@ enddef # Add a LSP server for a filetype def LspAddServer(ftype: string, lspsrv: dict) var lspsrvlst = ftypeServerMap->has_key(ftype) ? ftypeServerMap[ftype] : [] + for l in lspsrvlst + if l['name'] == lspsrv['name'] + return + endif + endfor lspsrvlst->add(lspsrv) ftypeServerMap[ftype] = lspsrvlst enddef