mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 09:48:59 +02:00
fix(cmake): lazy load cmake-tools. Fixes #2767
This commit is contained in:
parent
1c13a5c10b
commit
69aedc2657
1 changed files with 19 additions and 1 deletions
|
@ -43,7 +43,25 @@ return {
|
|||
},
|
||||
{
|
||||
"Civitasv/cmake-tools.nvim",
|
||||
lazy = true,
|
||||
init = function()
|
||||
local loaded = false
|
||||
local function check()
|
||||
local cwd = vim.uv.cwd()
|
||||
if vim.fn.filereadable(cwd .. "/CMakeLists.txt") == 1 then
|
||||
require("lazy").load({ plugins = { "cmake-tools.nvim" } })
|
||||
loaded = true
|
||||
end
|
||||
end
|
||||
check()
|
||||
vim.api.nvim_create_autocmd("DirChanged", {
|
||||
callback = function()
|
||||
if not loaded then
|
||||
check()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {},
|
||||
event = "LazyFile",
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue