Expand default target directory (if you Open/Save from a New file)

This commit is contained in:
Isaiah Odhner 2023-06-10 21:09:02 -04:00
parent 4e1f11ab23
commit 6fae6e501e

View File

@ -49,6 +49,11 @@ class EnhancedDirectoryTree(DirectoryTree):
else: else:
# print("scrolling", node) # print("scrolling", node)
_go_to_node(node) _go_to_node(node)
# If the target path is a directory, expand it.
# This might not always be desired, for a general API,
# but for File > New, File > Open, it should expand the current directory.
if node.data.path.is_dir():
_add_to_load_queue(node)
return node return node
node.add = add.__get__(node, type(node)) node.add = add.__get__(node, type(node))