1
0
Fork 0

fix ansible filetype detection

This commit is contained in:
Luca Bilke 2024-02-22 16:10:33 +01:00
parent 26d45f0210
commit 31c6be45ce

View file

@ -1,4 +1,8 @@
local ansible_test = function(path, bufnr)
if string.find(path, "templates") or string.find(path, "files") then
return "yaml"
end
local find = { "tasks", "roles", "handlers", "group_vars", "host_vars", "ansible.cfg", ".ansible-lint" }
local opts = { stop = os.getenv("HOME"), upward = true, limit = 1, path = path }
if next(vim.fs.find(find, opts)) ~= nil then