diff options
| author | Francesco Abbate <francesco.bbt@gmail.com> | 2022-01-06 00:10:14 +0100 |
|---|---|---|
| committer | Francesco Abbate <francesco.bbt@gmail.com> | 2022-01-06 00:10:14 +0100 |
| commit | 7704e13cafd4c32428ee4ce35cd7d0d5fc00a83d (patch) | |
| tree | 2cc6570d7f3e6fb3255b5e52327225a52337bf05 /data/core | |
| parent | 1e7075ca9fb59c4f237d747ee7e7fd06baaf183a (diff) | |
| download | lite-xl-fix-dmon-add-dir-asserts.tar.gz lite-xl-fix-dmon-add-dir-asserts.zip | |
Fix undue asserts in dmon_extrafix-dmon-add-dir-asserts
Some asserts are placed in case that can effectively occur
so we remove the assertion and we return false. In turn we
adapt the logic accordingly so when false is returned to add
a watch we do not open that directory.
Diffstat (limited to 'data/core')
| -rw-r--r-- | data/core/init.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/data/core/init.lua b/data/core/init.lua index aba10d8f..ba53d1a7 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -197,14 +197,14 @@ end function core.project_subdir_set_show(dir, filename, show) - dir.shown_subdir[filename] = show if dir.files_limit and not dir.force_rescan then local fullpath = dir.name .. PATHSEP .. filename - local success = (show and system.watch_dir_add or system.watch_dir_rm)(dir.watch_id, fullpath) - if not success then - core.log("Internal warning: error calling system.watch_dir_%s", show and "add" or "rm") + if not (show and system.watch_dir_add or system.watch_dir_rm)(dir.watch_id, fullpath) then + return false end end + dir.shown_subdir[filename] = show + return true end |
