mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Be more optimistic about when the node content is loaded
As per https://github.com/Textualize/textual/pull/2545#discussion_r1196589864
This commit is contained in:
@@ -303,7 +303,6 @@ class DirectoryTree(Tree[DirEntry]):
|
|||||||
The list of entries within the directory associated with the node.
|
The list of entries within the directory associated with the node.
|
||||||
"""
|
"""
|
||||||
assert node.data is not None
|
assert node.data is not None
|
||||||
node.data.loaded = True
|
|
||||||
return sorted(
|
return sorted(
|
||||||
self.filter_paths(
|
self.filter_paths(
|
||||||
self._directory_content(node.data.path, get_current_worker())
|
self._directory_content(node.data.path, get_current_worker())
|
||||||
@@ -346,6 +345,7 @@ class DirectoryTree(Tree[DirEntry]):
|
|||||||
return
|
return
|
||||||
if self._safe_is_dir(dir_entry.path):
|
if self._safe_is_dir(dir_entry.path):
|
||||||
if not dir_entry.loaded:
|
if not dir_entry.loaded:
|
||||||
|
dir_entry.loaded = True
|
||||||
self._load_queue.put_nowait(event.node)
|
self._load_queue.put_nowait(event.node)
|
||||||
else:
|
else:
|
||||||
self.post_message(self.FileSelected(self, event.node, dir_entry.path))
|
self.post_message(self.FileSelected(self, event.node, dir_entry.path))
|
||||||
|
|||||||
Reference in New Issue
Block a user