fix(explorer): strip cwd from search text for explorer items

This commit is contained in:
Folke Lemaitre 2025-02-04 20:40:29 +01:00
parent 3fd437ccd3
commit 38f392a8ad
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -296,6 +296,7 @@ function M.search(opts, ctx)
if basename:sub(1, 1) == "." then if basename:sub(1, 1) == "." then
item.hidden = true item.hidden = true
end end
item.text = item.text:sub(1, #opts.cwd) == opts.cwd and item.text:sub(#opts.cwd + 2) or item.text
local node = Tree:find(item.file) local node = Tree:find(item.file)
if node then if node then
item.status = (not node.dir or opts.git_status_open) and node.status or nil item.status = (not node.dir or opts.git_status_open) and node.status or nil