|
@@ -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
|