fix(root): escape glob expressions

This commit is contained in:
Folke Lemaitre 2024-05-30 11:03:02 +02:00
parent b285a46dfc
commit 7414e84af9
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -52,7 +52,7 @@ function M.detectors.pattern(buf, patterns)
if name == p then
return true
end
if p:sub(1, 1) == "*" and name:find(p:sub(2) .. "$") then
if p:sub(1, 1) == "*" and name:find(vim.pesc(p:sub(2)) .. "$") then
return true
end
end