cleanup
This commit is contained in:
parent
8cfb2a3019
commit
a0f8c507c0
|
@ -127,24 +127,12 @@ return {
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
ft = M.clang_filetypes,
|
ft = M.clang_filetypes,
|
||||||
config = function()
|
config = function()
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
local dir = find_compile_commands()
|
||||||
group = vim.api.nvim_create_augroup('clangd-lazy-init', { clear = true }),
|
M.start_clangd(dir)
|
||||||
pattern = table.concat(M.clang_filetypes, ','),
|
if dir ~= '' then
|
||||||
callback = function(args)
|
M.watch_compile_commands(dir)
|
||||||
local ft = vim.bo[args.buf].filetype
|
end
|
||||||
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
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd', buffer = args.buf })
|
vim.keymap.set('n', '<leader>cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd' })
|
||||||
vim.api.nvim_clear_autocmds { group = 'clangd-lazy-init' }
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue