diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2024-05-22 19:03:11 -0700 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2024-06-02 18:14:17 -0700 |
commit | 584adfe7c665827601f4245c0c40273e8bc9e7cb (patch) | |
tree | 7204fbcd5f4bf323de6ead54977f79399884c6fa /lua/conform/util.lua | |
parent | 0b6ef80e052150391ded101a0a2720f24f5200e9 (diff) |
fix: use vim.fs.root in neovim 0.10
Diffstat (limited to 'lua/conform/util.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) |