fix: remove duplicate entries (#99)

Co-authored-by: Munif Tanjim <hello@muniftanjim.dev>
This commit is contained in:
JINNOUCHI Yasushi 2023-06-19 09:56:08 +09:00 committed by GitHub
parent 3ddaaa0a60
commit 62d3381a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,19 @@ util.buf_is_loaded = function(filename)
end end
util.include_unindexed = function(files, ws_path) util.include_unindexed = function(files, ws_path)
local scan_opts = { respect_gitignore = true, depth = 100, hidden = true } local is_indexed = {}
for _, item in ipairs(files) do
is_indexed[item.path] = true
end
local scan_opts = {
respect_gitignore = true,
depth = 100,
hidden = true,
search_pattern = function(file)
return not is_indexed[file]
end,
}
-- TODO: make sure scandir unindexed have opts.ignore_patterns applied -- TODO: make sure scandir unindexed have opts.ignore_patterns applied
-- TODO: make filters handle mulitple directories -- TODO: make filters handle mulitple directories