Ensure directory is rescanned after the first read

This commit is contained in:
Francesco Abbate 2021-07-23 21:23:37 +02:00
parent b214471a1b
commit 3af4d9fd59
1 changed files with 3 additions and 2 deletions

View File

@ -165,6 +165,7 @@ local function scan_project_folder(index)
end
end
dir.files = t
core.dir_rescan_add_job(dir, ".")
end
@ -1038,7 +1039,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
@ -1083,7 +1084,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