File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 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"
44local events = require " nvim-tree.events"
55local lib = require " nvim-tree.lib"
66local core = require " nvim-tree.core"
7+ local watch = require " nvim-tree.explorer.watch"
78
89local M = {}
910
@@ -108,7 +109,8 @@ function M.fn(node)
108109 if M .enable_reload then
109110 require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer ()
110111 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 )
112114 end
113115 utils .focus_file (utils .path_remove_trailing (new_file_path ))
114116 end )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ local function is_folder_ignored(path)
3939 return false
4040end
4141
42- local function refresh_path (path )
42+ function M . refresh_path (path )
4343 log .line (" watcher" , " node event executing '%s'" , path )
4444 local n = utils .get_node_from_path (path )
4545 if not n then
@@ -65,7 +65,7 @@ function M.create_watcher(absolute_path)
6565 local function callback (watcher )
6666 log .line (" watcher" , " node event scheduled %s" , watcher .context )
6767 utils .debounce (watcher .context , M .debounce_delay , function ()
68- refresh_path (watcher ._path )
68+ M . refresh_path (watcher ._path )
6969 end )
7070 end
7171
You can’t perform that action at this time.
0 commit comments