File tree 1 file changed +7
-8
lines changed
lua/nvim-tree/actions/finders
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -15,23 +15,20 @@ function M.fn(fname)
15
15
if running [fname ] or not core .get_explorer () then
16
16
return
17
17
end
18
+ running [fname ] = true
18
19
20
+ local ps = log .profile_start (" find file %s" , fname )
19
21
-- always match against the real path
20
22
local fname_real = vim .loop .fs_realpath (fname )
21
23
if not fname_real then
22
24
return
23
25
end
24
26
25
- running [fname ] = true
26
-
27
- local ps = log .profile_start (" find file %s" , fname )
28
-
29
- -- first line is the root node
30
- local line = core .get_nodes_starting_line () - 1
27
+ local line = core .get_nodes_starting_line ()
31
28
32
29
local absolute_paths_searched = {}
33
30
34
- local found = Iterator .builder ({ core .get_explorer () } )
31
+ local found = Iterator .builder (core .get_explorer (). nodes )
35
32
:matcher (function (node )
36
33
return node .absolute_path == fname_real or node .link_to == fname_real
37
34
end )
@@ -48,7 +45,9 @@ function M.fn(fname)
48
45
49
46
if abs_match or link_match then
50
47
node .open = true
51
- core .get_explorer ():expand (node )
48
+ if # node .nodes == 0 then
49
+ core .get_explorer ():expand (node )
50
+ end
52
51
end
53
52
end )
54
53
:recursor (function (node )
You can’t perform that action at this time.
0 commit comments