fix(picker.filter): get cwd from active tabpage if available

This commit is contained in:
Folke Lemaitre 2025-10-28 08:43:37 +01:00
parent 52f30a198a
commit c1b517f545
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -38,7 +38,7 @@ function M:init(opts)
self.all = not self.opts or not (self.opts.cwd or self.opts.buf or self.opts.paths or self.opts.filter)
self.paths = {}
local cwd = self.opts and self.opts.cwd
self.cwd = type(cwd) == "string" and cwd or opts.cwd or uv.cwd() or "."
self.cwd = type(cwd) == "string" and cwd or opts.cwd or vim.fn.getcwd(0)
self.cwd = svim.fs.normalize(self.cwd --[[@as string]], { _fast = true })
if not self.all and self.opts then
self.buf = self.opts.buf == true and 0 or self.opts.buf --[[@as number?]]