From a0f8c507c07aeb614e8d736e9bd067f6a5e71595 Mon Sep 17 00:00:00 2001 From: dlond Date: Fri, 30 May 2025 06:11:14 +1200 Subject: [PATCH] cleanup --- lua/custom/plugins/lsp/clangd.lua | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/lua/custom/plugins/lsp/clangd.lua b/lua/custom/plugins/lsp/clangd.lua index ec48c413..63db56f7 100644 --- a/lua/custom/plugins/lsp/clangd.lua +++ b/lua/custom/plugins/lsp/clangd.lua @@ -127,24 +127,12 @@ return { 'neovim/nvim-lspconfig', ft = M.clang_filetypes, config = function() - vim.api.nvim_create_autocmd('FileType', { - group = vim.api.nvim_create_augroup('clangd-lazy-init', { clear = true }), - pattern = table.concat(M.clang_filetypes, ','), - callback = function(args) - local ft = vim.bo[args.buf].filetype - if vim.tbl_contains(M.clang_filetypes, ft) then - local dir = find_compile_commands() - M.start_clangd(dir) - if dir ~= '' then - M.watch_compile_commands(dir) - else - M.watch_compile_commands() - end + local dir = find_compile_commands() + M.start_clangd(dir) + if dir ~= '' then + M.watch_compile_commands(dir) + end - vim.keymap.set('n', 'cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd', buffer = args.buf }) - vim.api.nvim_clear_autocmds { group = 'clangd-lazy-init' } - end - end, - }) + vim.keymap.set('n', 'cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd' }) end, }