Ensure TreeView cache entry is removed on delete
Address issue:
https://github.com/lite-xl/lite-xl/issues/689
Attempt to provide a more accurate fix to commit:
59f64088e1
For this latter what happens is that any change inside a directory
cause the corresponding entry to be folded in the TreeView.
The new change is more accurate because we remove only the stale
entry corresponding to the delete event and we do not reset the
cache of the parent directory using the modify event.
This commit is contained in:
+3
-2
@@ -1164,8 +1164,8 @@ end
|
||||
|
||||
|
||||
-- no-op but can be overrided by plugins
|
||||
function core.on_dirmonitor_modify()
|
||||
end
|
||||
function core.on_dirmonitor_modify() end
|
||||
function core.on_dirmonitor_delete() end
|
||||
|
||||
|
||||
function core.on_dir_change(watch_id, action, filepath)
|
||||
@@ -1174,6 +1174,7 @@ function core.on_dir_change(watch_id, action, filepath)
|
||||
core.dir_rescan_add_job(dir, filepath)
|
||||
if action == "delete" then
|
||||
project_scan_remove_file(dir, filepath)
|
||||
core.on_dirmonitor_delete(dir, filepath)
|
||||
elseif action == "create" then
|
||||
project_scan_add_file(dir, filepath)
|
||||
core.on_dirmonitor_modify(dir, filepath);
|
||||
|
||||
Reference in New Issue
Block a user