aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform
diff options
context:
space:
mode:
authorSteven Arcangeli <stevearc@stevearc.com>2024-05-22 19:03:11 -0700
committerSteven Arcangeli <stevearc@stevearc.com>2024-06-02 18:14:17 -0700
commit584adfe7c665827601f4245c0c40273e8bc9e7cb (patch)
tree7204fbcd5f4bf323de6ead54977f79399884c6fa /lua/conform
parent0b6ef80e052150391ded101a0a2720f24f5200e9 (diff)
fix: use vim.fs.root in neovim 0.10
Diffstat (limited to 'lua/conform')
-rw-r--r--lua/conform/util.lua3
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)