dirmonitor: add watch to subdirs on file limit mode (#1155)

This commit is contained in:
Jefferson González 2022-10-13 00:37:52 -04:00 committed by GitHub
parent fb8bc08a67
commit f89088d0ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -373,6 +373,11 @@ end
function core.update_project_subdir(dir, filename, expanded)
assert(dir.files_limit, "function should be called only when directory is in files limit mode")
dir.shown_subdir[filename] = expanded
if expanded then
dir.watch:watch(dir.name .. PATHSEP .. filename)
else
dir.watch:unwatch(dir.name .. PATHSEP .. filename)
end
return refresh_directory(dir, filename)
end