fix: exclude directories from oldfiles picker (#2485)

This commit is contained in:
Pete Matsyburka
2023-05-14 23:04:46 +03:00
committed by GitHub
parent 89c67676a8
commit 0900f6fcaa

View File

@@ -519,7 +519,8 @@ internal.oldfiles = function(opts)
end
for _, file in ipairs(vim.v.oldfiles) do
if vim.loop.fs_stat(file) and not vim.tbl_contains(results, file) and file ~= current_file then
local file_stat = vim.loop.fs_stat(file)
if file_stat and file_stat.type == "file" and not vim.tbl_contains(results, file) and file ~= current_file then
table.insert(results, file)
end
end