fix(old_files): opts.cwd_only includes similarly named dirs (#2308)

(cherry picked from commit 04af51dbfb)
This commit is contained in:
emmanueltouzery
2023-01-07 12:45:58 +01:00
committed by GitHub
parent 96c4060084
commit f7bceabcc9
+1 -1
View File
@@ -517,7 +517,7 @@ internal.oldfiles = function(opts)
end
if opts.cwd_only then
local cwd = vim.loop.cwd()
local cwd = vim.loop.cwd() .. "/"
cwd = cwd:gsub([[\]], [[\\]])
results = vim.tbl_filter(function(file)
return vim.fn.matchstrpos(file, cwd)[2] ~= -1