1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

TOOLS/lua/autoload: load files even if current file is hidden

When the current file is hidden and `ignore_hidden` is true,
autoload will skip loading other files in the current directory. Make
sure that the current file is always counted for autoloading even if it
is hidden.
This commit is contained in:
LaserEyess 2021-06-23 13:17:34 -04:00 committed by Dudemanguy
parent 28c53dbfa0
commit ee27629244

View File

@ -157,7 +157,9 @@ function find_and_add_entries()
return
end
table.filter(files, function (v, k)
if (o.ignore_hidden and string.match(v, "^%.")) then
-- The current file could be a hidden file, ignoring it doesn't load other
-- files from the current directory.
if (o.ignore_hidden and not (v == filename) and string.match(v, "^%.")) then
return false
end
local ext = get_extension(v)