Skip to content

Commit ae0eb0f

Browse files
tui: nicer approach to updating
1 parent a411aae commit ae0eb0f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cylc/flow/tui/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,11 @@ def update(self, *_):
515515
_, old_node = self.listbox.body.get_focus()
516516

517517
# nuke the tree
518-
self.tree_walker = urwid.TreeWalker(topnode)
519-
self.listbox.body = self.tree_walker
518+
if not (self.tree_walker):
519+
self.tree_walker = urwid.TreeWalker(topnode)
520+
self.listbox.body = self.tree_walker
521+
else:
522+
self.tree_walker.set_focus(topnode)
520523

521524
# get the new focus
522525
_, new_node = self.listbox.body.get_focus()

0 commit comments

Comments
 (0)