fix: exclude directories from oldfiles picker (#2485)

(cherry picked from commit 0900f6fcaa)
This commit is contained in:
Pete Matsyburka
2023-05-14 23:04:46 +03:00
committed by Simon Hauser
parent ce5cc56dee
commit a49c3aa977
+2 -1
View File
@@ -512,7 +512,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