summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaserEyess <lasereyess@users.noreply.github.com>2021-06-23 13:17:34 -0400
committerDudemanguy <random342@airmail.cc>2021-06-24 13:13:53 +0000
commitee2762924412211bcac76e3aaae07e880fd284a8 (patch)
tree97bbe38ea63cdbe2d6d9de9a3c8597e37ca05f29
parent28c53dbfa0fa9cd812818371e24aaed08683be66 (diff)
downloadmpv-ee2762924412211bcac76e3aaae07e880fd284a8.tar.bz2
mpv-ee2762924412211bcac76e3aaae07e880fd284a8.tar.xz
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.
-rw-r--r--TOOLS/lua/autoload.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/TOOLS/lua/autoload.lua b/TOOLS/lua/autoload.lua
index 10c7fbdef0..aa7e46d060 100644
--- a/TOOLS/lua/autoload.lua
+++ b/TOOLS/lua/autoload.lua
@@ -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)