fix(create-file): when node is nil, create the file at root

fixes #1467
This commit is contained in:
kiyan
2022-07-27 09:33:01 +02:00
parent 64cc3c17e1
commit e632ac7c81

View File

@@ -48,8 +48,8 @@ local function get_containing_folder(node)
end end
function M.fn(node) function M.fn(node)
node = lib.get_last_group_node(node) node = node and lib.get_last_group_node(node)
if node.name == ".." then if not node or node.name == ".." then
node = { node = {
absolute_path = core.get_cwd(), absolute_path = core.get_cwd(),
nodes = core.get_explorer().nodes, nodes = core.get_explorer().nodes,