File tree 6 files changed +282
-290
lines changed
6 files changed +282
-290
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ local log = require "nvim-tree.log"
2
2
local view = require " nvim-tree.view"
3
3
local utils = require " nvim-tree.utils"
4
4
local renderer = require " nvim-tree.renderer"
5
- local reload = require " nvim-tree.explorer.reload"
6
5
local core = require " nvim-tree.core"
7
6
local Iterator = require " nvim-tree.iterators.node-iterator"
8
7
@@ -13,7 +12,8 @@ local running = {}
13
12
--- Find a path in the tree, expand it and focus it
14
13
--- @param path string relative or absolute
15
14
function M .fn (path )
16
- if not core .get_explorer () or not view .is_visible () then
15
+ local explorer = core .get_explorer ()
16
+ if not explorer or not view .is_visible () then
17
17
return
18
18
end
19
19
@@ -32,7 +32,7 @@ function M.fn(path)
32
32
33
33
-- refresh the contents of all parents, expanding groups as needed
34
34
if utils .get_node_from_path (path_real ) == nil then
35
- reload . refresh_parent_nodes_for_path (vim .fn .fnamemodify (path_real , " :h" ))
35
+ explorer : refresh_parent_nodes_for_path (vim .fn .fnamemodify (path_real , " :h" ))
36
36
end
37
37
38
38
local line = core .get_nodes_starting_line ()
Original file line number Diff line number Diff line change 1
1
local git = require " nvim-tree.git"
2
2
local view = require " nvim-tree.view"
3
3
local renderer = require " nvim-tree.renderer"
4
- local explorer_module = require " nvim-tree.explorer"
5
4
local core = require " nvim-tree.core"
6
5
local explorer_node = require " nvim-tree.explorer.node"
7
6
local Iterator = require " nvim-tree.iterators.node-iterator"
8
7
9
8
local M = {}
10
9
11
- --- @param node Explorer | nil
10
+ --- @param explorer Explorer | nil
12
11
--- @param projects table
13
- local function refresh_nodes (node , projects )
14
- Iterator .builder ({ node })
12
+ local function refresh_nodes (explorer , projects )
13
+ Iterator .builder ({ explorer })
15
14
:applier (function (n )
16
15
if n .nodes then
17
16
local toplevel = git .get_toplevel (n .cwd or n .link_to or n .absolute_path )
18
- explorer_module .reload (n , projects [toplevel ] or {})
17
+ if explorer then
18
+ explorer :reload (n , projects [toplevel ] or {})
19
+ end
19
20
end
20
21
end )
21
22
:recursor (function (n )
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ function M.init(foldername)
16
16
if TreeExplorer then
17
17
TreeExplorer :destroy ()
18
18
end
19
- TreeExplorer = explorer . Explorer . new (foldername )
19
+ TreeExplorer = explorer : new (foldername )
20
20
if not first_init_done then
21
21
events ._dispatch_ready ()
22
22
first_init_done = true
You can’t perform that action at this time.
0 commit comments