File tree 3 files changed +7
-20
lines changed
3 files changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ function M.fn(fname)
30
30
31
31
local ps = log .profile_start (" find file %s" , fname_real )
32
32
33
- if not M .filesystem_watchers_enabled then
34
- reload .refresh_nodes_for_path (vim .fn .fnamemodify (fname_real , " :h" ))
35
- end
33
+ -- we cannot wait for watchers
34
+ reload .refresh_nodes_for_path (vim .fn .fnamemodify (fname_real , " :h" ))
36
35
37
36
local line = core .get_nodes_starting_line ()
38
37
@@ -75,8 +74,4 @@ function M.fn(fname)
75
74
log .profile_end (ps , " find file %s" , fname_real )
76
75
end
77
76
78
- function M .setup (opts )
79
- M .filesystem_watchers_enabled = opts .filesystem_watchers .enabled
80
- end
81
-
82
77
return M
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ local utils = require "nvim-tree.utils"
2
2
local events = require " nvim-tree.events"
3
3
local lib = require " nvim-tree.lib"
4
4
local core = require " nvim-tree.core"
5
- local reload = require " nvim-tree.explorer.reload"
6
5
local notify = require " nvim-tree.notify"
7
6
7
+ local find_file = require (" nvim-tree.actions.finders.find-file" ).fn
8
+
8
9
local M = {}
9
10
10
11
local function create_and_notify (file )
@@ -105,17 +106,9 @@ function M.fn(node)
105
106
if not is_error then
106
107
notify .info (new_file_path .. " was properly created" )
107
108
end
108
- if M .enable_reload then
109
- require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer ()
110
- else
111
- -- synchronous call required so that we may focus the file now
112
- node = node .nodes ~= nil and node or node .parent
113
- if node then
114
- reload .refresh_node (node )
115
- end
116
- end
117
- -- TODO #1731 #1716 this gets upset by watcher add new file to linked directories above
118
- utils .focus_file (utils .path_remove_trailing (new_file_path ))
109
+
110
+ -- synchronously refreshes as we can't wait for the watchers
111
+ find_file (utils .path_remove_trailing (new_file_path ))
119
112
end )
120
113
end
121
114
Original file line number Diff line number Diff line change @@ -385,7 +385,6 @@ local DEFAULT_MAPPING_CONFIG = {
385
385
}
386
386
387
387
function M .setup (opts )
388
- require (" nvim-tree.actions.finders.find-file" ).setup (opts )
389
388
require (" nvim-tree.actions.fs.trash" ).setup (opts )
390
389
require (" nvim-tree.actions.node.system-open" ).setup (opts )
391
390
require (" nvim-tree.actions.node.file-popup" ).setup (opts )
You can’t perform that action at this time.
0 commit comments