File tree 2 files changed +5
-3
lines changed
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ 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"
7
8
8
9
local M = {}
9
10
@@ -108,7 +109,8 @@ function M.fn(node)
108
109
if M .enable_reload then
109
110
require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer ()
110
111
else
111
- require (" nvim-tree.explorer.reload" ).reload (node , {})
112
+ -- synchronous call required so that we may focus the file now
113
+ watch .refresh_path (node .absolute_path )
112
114
end
113
115
utils .focus_file (utils .path_remove_trailing (new_file_path ))
114
116
end )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ local function is_folder_ignored(path)
39
39
return false
40
40
end
41
41
42
- local function refresh_path (path )
42
+ function M . refresh_path (path )
43
43
log .line (" watcher" , " node event executing '%s'" , path )
44
44
local n = utils .get_node_from_path (path )
45
45
if not n then
@@ -65,7 +65,7 @@ function M.create_watcher(absolute_path)
65
65
local function callback (watcher )
66
66
log .line (" watcher" , " node event scheduled %s" , watcher .context )
67
67
utils .debounce (watcher .context , M .debounce_delay , function ()
68
- refresh_path (watcher ._path )
68
+ M . refresh_path (watcher ._path )
69
69
end )
70
70
end
71
71
You can’t perform that action at this time.
0 commit comments