fix(#1270): ensure explorer exists at startup before propagating FS changes
This commit is contained in:
@@ -117,6 +117,12 @@ end
|
|||||||
-- (grouped or hidden too)
|
-- (grouped or hidden too)
|
||||||
function M.get_node_from_path(path)
|
function M.get_node_from_path(path)
|
||||||
local explorer = require("nvim-tree.core").get_explorer()
|
local explorer = require("nvim-tree.core").get_explorer()
|
||||||
|
|
||||||
|
-- tree may not yet be loaded
|
||||||
|
if not explorer then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if explorer.absolute_path == path then
|
if explorer.absolute_path == path then
|
||||||
return explorer
|
return explorer
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user