From d36293ff6097374a9279695468f42c2d0adb3639 Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Fri, 23 Jul 2021 21:23:37 +0200 Subject: [PATCH] Ensure directory is rescanned after the first read --- data/core/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/core/init.lua b/data/core/init.lua index dc40408c..2aedddbe 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -168,6 +168,7 @@ local function scan_project_folder(index) end end dir.files = t + core.dir_rescan_add_job(dir, ".") end @@ -1041,7 +1042,7 @@ end local scheduled_rescan = {} -local function dir_rescan_add_job(dir, filepath) +function core.dir_rescan_add_job(dir, filepath) local dirpath = filepath:match("^(.+)[/\\].+$") local dirpath_rooted = dirpath and PATHSEP .. dirpath or "" local abs_dirpath = dir.name .. dirpath_rooted @@ -1086,7 +1087,7 @@ end function core.on_dir_change(watch_id, action, filepath) local dir = project_dir_by_watch_id(watch_id) if not dir then return end - dir_rescan_add_job(dir, filepath) + core.dir_rescan_add_job(dir, filepath) if action == "delete" then project_scan_remove_file(dir, filepath) elseif action == "create" then