Skip to content

Commit e632ac7

Browse files
committed
fix(create-file): when node is nil, create the file at root
fixes #1467
1 parent 64cc3c1 commit e632ac7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ local function get_containing_folder(node)
4848
end
4949

5050
function M.fn(node)
51-
node = lib.get_last_group_node(node)
52-
if node.name == ".." then
51+
node = node and lib.get_last_group_node(node)
52+
if not node or node.name == ".." then
5353
node = {
5454
absolute_path = core.get_cwd(),
5555
nodes = core.get_explorer().nodes,

0 commit comments

Comments
 (0)