changed deprecated cmd

This commit is contained in:
dlond 2025-05-30 01:12:36 +12:00
parent 1ba09dc67b
commit 5d7b298adc
1 changed files with 3 additions and 2 deletions

View File

@ -39,9 +39,9 @@ function M.setup_clangd(commands_dir)
} }
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
local ft = vim.api.nvim_buf_get_option(bufnr, 'filetype') local ft = vim.api.nvim_get_option_value('filetype', { buf = bufnr })
if vim.tbl_contains(M.clang_filetypes, ft) then if vim.tbl_contains(M.clang_filetypes, ft) then
vim.lsp.buf_attach_client(bufnr, vim.lsp.get_active_clients({ name = 'clangd' })[1].id) vim.lsp.buf_attach_client(bufnr, vim.lsp.get_clients({ name = 'clangd' })[1].id)
end end
end end
end end
@ -62,6 +62,7 @@ function M.pick_commands_dir()
require('telescope.actions').close(prompt_bufnr) require('telescope.actions').close(prompt_bufnr)
if commands_dir ~= '' then if commands_dir ~= '' then
M.setup_clangd(commands_dir) M.setup_clangd(commands_dir)
end
end) end)
return true return true
end, end,