File tree 2 files changed +14
-12
lines changed
2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ local utils = require "nvim-tree.utils"
4
4
local events = require " nvim-tree.events"
5
5
local lib = require " nvim-tree.lib"
6
6
local core = require " nvim-tree.core"
7
- local watch = require " nvim-tree.explorer.watch"
8
7
local notify = require " nvim-tree.notify"
9
8
10
9
local M = {}
@@ -101,22 +100,14 @@ function M.fn(node)
101
100
is_error = true
102
101
break
103
102
end
103
+ events ._dispatch_folder_created (path_to_create )
104
104
end
105
105
end
106
106
if not is_error then
107
107
notify .info (new_file_path .. " was properly created" )
108
108
end
109
- events ._dispatch_folder_created (new_file_path )
110
- if M .enable_reload then
111
- require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer ()
112
- else
113
- -- synchronous call required so that we may focus the file now
114
- node = node .nodes ~= nil and node or node .parent
115
- if node then
116
- watch .refresh_path (node .absolute_path )
117
- end
118
- end
119
- utils .focus_file (utils .path_remove_trailing (new_file_path ))
109
+ require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer ()
110
+ require (" nvim-tree.actions.finders.find-file" ).fn (new_file_path )
120
111
end )
121
112
end
122
113
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ local view = require "nvim-tree.view"
3
3
local renderer = require " nvim-tree.renderer"
4
4
local explorer_module = require " nvim-tree.explorer"
5
5
local core = require " nvim-tree.core"
6
+ local log = require " nvim-tree.log"
6
7
7
8
local M = {}
8
9
@@ -39,11 +40,16 @@ function M.reload_explorer()
39
40
end
40
41
event_running = true
41
42
43
+ local ps = log .profile_start " reload_explorer"
44
+
42
45
local projects = git .reload ()
43
46
refresh_nodes (core .get_explorer (), projects )
44
47
if view .is_visible () then
45
48
renderer .draw ()
46
49
end
50
+
51
+ log .profile_end (ps , " reload_explorer" )
52
+
47
53
event_running = false
48
54
end
49
55
@@ -53,9 +59,14 @@ function M.reload_git()
53
59
end
54
60
event_running = true
55
61
62
+ local ps = log .profile_start " reload_git"
63
+
56
64
local projects = git .reload ()
57
65
M .reload_node_status (core .get_explorer (), projects )
58
66
renderer .draw ()
67
+
68
+ log .profile_end (ps , " reload_git" )
69
+
59
70
event_running = false
60
71
end
61
72
You can’t perform that action at this time.
0 commit comments