refacto: set tree explorer in the global state

also remove the redraw method and use renderer.draw immediately
This commit is contained in:
kiyan
2022-02-07 22:07:08 +01:00
parent e42a4337d0
commit ea92e7bf7c
18 changed files with 85 additions and 93 deletions

View File

@@ -111,7 +111,6 @@ function M.update()
buffer_severity = from_nvim_lsp()
end
local nodes = require'nvim-tree.lib'.Tree.nodes
if #signs then
vim.fn.sign_unplacelist(vim.tbl_map(function(sign)
return {
@@ -124,7 +123,7 @@ function M.update()
end
for bufname, severity in pairs(buffer_severity) do
if 0 < severity and severity < 5 then
local node, line = utils.find_node(nodes, function(node)
local node, line = utils.find_node(TreeExplorer.nodes, function(node)
if M.show_on_dirs and not node.open then
return vim.startswith(bufname, node.absolute_path)
else