From 2cde745aadc2c36f6860a77a556494870675771a Mon Sep 17 00:00:00 2001 From: wiser-fz Date: Sat, 20 Jul 2024 00:17:42 +0800 Subject: [PATCH] Fix bug of get root directory (#163) --- lua/null-ls/utils/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/null-ls/utils/init.lua b/lua/null-ls/utils/init.lua index 8bf01255..36ff7281 100644 --- a/lua/null-ls/utils/init.lua +++ b/lua/null-ls/utils/init.lua @@ -228,8 +228,8 @@ M.get_root = function() if not root then local fname = api.nvim_buf_get_name(0) if fname ~= "" then - local v = assert(require("null-ls.config").get().root_dir(fname), "cannot infer root_dir") - root = v + -- if root is nil, it will be set to cwd + root = require("null-ls.config").get().root_dir(fname) end end