feat: find git root from current buffer (#2435)

This commit is contained in:
William Henrotin
2023-05-24 11:36:37 +02:00
committed by GitHub
parent 0b891ec934
commit 9f501680e5
3 changed files with 44 additions and 23 deletions

View File

@@ -382,6 +382,8 @@ end
local set_opts_cwd = function(opts)
if opts.cwd then
opts.cwd = vim.fn.expand(opts.cwd)
elseif opts.use_file_path then
opts.cwd = vim.fn.finddir(".git", vim.fn.expand "%:p" .. ";")
else
opts.cwd = vim.loop.cwd()
end