diff options
Diffstat (limited to 'lua')
-rw-r--r-- | lua/conform/util.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lua/conform/util.lua b/lua/conform/util.lua index fe2a306..1222af2 100644 --- a/lua/conform/util.lua +++ b/lua/conform/util.lua @@ -49,6 +49,9 @@ end ---@return fun(self: conform.FormatterConfig, ctx: conform.Context): nil|string M.root_file = function(files) return function(self, ctx) + if vim.fn.has("nvim-0.10") == 1 then + return vim.fs.root(ctx.dirname, files) + end local found = vim.fs.find(files, { upward = true, path = ctx.dirname })[1] if found then return vim.fs.dirname(found) |