aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Lithammer <peter.lithammer@gmail.com>2021-04-09 22:43:45 +0200
committerGitHub <noreply@github.com>2021-04-09 22:43:45 +0200
commit4b37c5120090cf48c234aed60e7d815bde3c7337 (patch)
tree2d8e45523f41e3a9891cc45f15a3ca262067238b
parent[docgen] Update README.md (diff)
parent[docgen] Update CONFIG.md (diff)
downloadnvim-lspconfig-4b37c5120090cf48c234aed60e7d815bde3c7337.tar
nvim-lspconfig-4b37c5120090cf48c234aed60e7d815bde3c7337.tar.gz
nvim-lspconfig-4b37c5120090cf48c234aed60e7d815bde3c7337.tar.bz2
nvim-lspconfig-4b37c5120090cf48c234aed60e7d815bde3c7337.tar.lz
nvim-lspconfig-4b37c5120090cf48c234aed60e7d815bde3c7337.tar.xz
nvim-lspconfig-4b37c5120090cf48c234aed60e7d815bde3c7337.tar.zst
nvim-lspconfig-4b37c5120090cf48c234aed60e7d815bde3c7337.zip
Merge pull request #377 from tkonolige/master
Fix root_pattern for wildcards and file in wildignore
-rw-r--r--lua/lspconfig/util.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index dca330ae..dc06f181 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -249,8 +249,10 @@ function M.root_pattern(...)
local patterns = vim.tbl_flatten {...}
local function matcher(path)
for _, pattern in ipairs(patterns) do
- if M.path.exists(vim.fn.glob(M.path.join(path, pattern))) then
- return path
+ for _, p in ipairs(vim.fn.glob(M.path.join(path, pattern), true, true)) do
+ if M.path.exists(p) then
+ return path
+ end
end
end
end