feat: add project_root in AskOptions so that project root can be specified from api (#2652)

This commit is contained in:
brook hong
2025-08-30 18:07:59 +08:00
committed by GitHub
parent f70c4b8b88
commit 9008fc4f41
4 changed files with 6 additions and 4 deletions

View File

@@ -193,6 +193,7 @@ local buf_names = {}
---@param opts? {normalize?:boolean, buf?:number}
---@return string
function M.get(opts)
if Config.ask_opts.project_root then return Config.ask_opts.project_root end
local cwd = vim.uv.cwd()
if Config.behaviour.use_cwd_as_project_root then
if cwd and cwd ~= "" then return cwd end