cleanup
This commit is contained in:
parent
8cfb2a3019
commit
a0f8c507c0
|
@ -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
|
||||
|
||||
vim.keymap.set('n', '<leader>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', '<leader>cc', M.pick_commands_dir, { desc = 'Pick location of compile_commands.json for clangd' })
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue