mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
fix(lvim/lsp/manager): make client_is_configured more reliable (#2851)
This commit is contained in:
parent
caac70d22e
commit
b8f681374b
1 changed files with 2 additions and 2 deletions
|
@ -37,9 +37,9 @@ end
|
||||||
-- which seems to occur only when attaching to single-files
|
-- which seems to occur only when attaching to single-files
|
||||||
local function client_is_configured(server_name, ft)
|
local function client_is_configured(server_name, ft)
|
||||||
ft = ft or vim.bo.filetype
|
ft = ft or vim.bo.filetype
|
||||||
local active_autocmds = vim.split(vim.fn.execute("autocmd FileType " .. ft), "\n")
|
local active_autocmds = vim.api.nvim_get_autocmds { event = "FileType", pattern = ft }
|
||||||
for _, result in ipairs(active_autocmds) do
|
for _, result in ipairs(active_autocmds) do
|
||||||
if result:match(server_name) then
|
if result.command:match(server_name) then
|
||||||
Log:debug(string.format("[%q] is already configured", server_name))
|
Log:debug(string.format("[%q] is already configured", server_name))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue