From ee2762924412211bcac76e3aaae07e880fd284a8 Mon Sep 17 00:00:00 2001 From: LaserEyess Date: Wed, 23 Jun 2021 13:17:34 -0400 Subject: 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. --- TOOLS/lua/autoload.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3