feat(explorer): add filesystem watchers (#1304)

* feat(explorer): add experimental watchers

This commit introduces watchers to update the tree.
This behavior is introduced behind an "filesystem_watchers" option
which should prevent instabilities.
It will become the default at some point.

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Kiyan
2022-06-05 12:39:39 +02:00
committed by GitHub
parent a5793f1edb
commit b0d27c09b6
19 changed files with 379 additions and 38 deletions

View File

@@ -37,9 +37,15 @@ function M.fn(with_sub)
a.nvim_out_write(node.absolute_path .. "" .. new_file_path .. "\n")
utils.rename_loaded_buffers(node.absolute_path, new_file_path)
events._dispatch_node_renamed(abs_path, new_file_path)
require("nvim-tree.actions.reloaders").reload_explorer()
if M.enable_reload then
require("nvim-tree.actions.reloaders").reload_explorer()
end
end)
end
end
function M.setup(opts)
M.enable_reload = not opts.filesystem_watchers.enable
end
return M