diff --git a/lua/plugins/astrolsp.lua b/lua/plugins/astrolsp.lua index b633875..f1c8c31 100644 --- a/lua/plugins/astrolsp.lua +++ b/lua/plugins/astrolsp.lua @@ -57,7 +57,14 @@ return { "--query-driver=/usr/bin/*gcc", "--function-arg-placeholders=0", }, - root_dir = require("lspconfig.util").root_pattern(".git") or vim.fn.getcwd(), + root_dir = function(path) + local normal = require("lspconfig.util").root_pattern(".git")(vim.fn.getcwd()) + if normal then + return normal + else + return vim.fn.getcwd() + end + end, filetypes = { "cpp", "c" }, capabilities = { offsetEncoding = "utf-8",