Fix ltex_extra

This commit is contained in:
Thomas Avé 2025-05-08 14:46:15 +02:00
parent aa179f7e25
commit 9e92e2fef0
2 changed files with 15 additions and 6 deletions

View File

@ -13,12 +13,21 @@ local types = {
local function catch_ltex()
log.trace("catch_ltex")
local buf_clients = vim.lsp.buf_get_clients()
local client = nil
for _, lsp in ipairs(buf_clients) do
if lsp.name == "ltex" then client = lsp end
local client_getter = vim.lsp.get_clients and vim.lsp.get_clients or vim.lsp.get_active_clients
local buf_clients = client_getter({
bufnr = vim.api.nvim_get_current_buf(),
name = "ltex",
})
if vim.tbl_isempty(buf_clients) then
buf_clients = client_getter({
bufnr = vim.api.nvim_get_current_buf(),
name = "ltex_plus",
})
end
return client
return buf_clients[1]
end
local function update_language(client, lang)

View File

@ -24,7 +24,7 @@
element-desktop
evince
loupe
gimp
gimp3
obs-studio
inkscape
gnome-calendar