Skip to content

Commit 6a51945

Browse files
committed
fix(#1615): focus created file when command line prompt requires confirmation
1 parent 52b0c32 commit 6a51945

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lua/nvim-tree/actions/fs/create-file.lua

+3-4
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,10 @@ function M.fn(node)
107107
events._dispatch_folder_created(new_file_path)
108108
if M.enable_reload then
109109
require("nvim-tree.actions.reloaders.reloaders").reload_explorer()
110+
else
111+
require("nvim-tree.explorer.reload").reload(node, {})
110112
end
111-
-- INFO: defer needed when reload is automatic (watchers)
112-
vim.defer_fn(function()
113-
utils.focus_file(utils.path_remove_trailing(new_file_path))
114-
end, 150)
113+
utils.focus_file(utils.path_remove_trailing(new_file_path))
115114
end)
116115
end
117116

0 commit comments

Comments
 (0)