> > > I checked out tree-refresh, then attempted to clone qt_tree.py: > > Traceback (most recent call last): > > File "c:\leo.repo\leo-editor\leo\core\leoCommands.py", line 2282, in > executeAnyCommand > return command(event) > > File "c:\leo.repo\leo-editor\leo\core\leoGlobals.py", line 245, in > commander_command_wrapper > method(event=event) > > File "c:\leo.repo\leo-editor\leo\commands\commanderOutlineCommands.py", > line 736, in clone > c.redraw(clone) > > File "c:\leo.repo\leo-editor\leo\core\leoCommands.py", line 2950, in > redraw > p2 = c.frame.tree.redraw(p) > > File "c:\leo.repo\leo-editor\leo\plugins\qt_tree.py", line 309, in > full_redraw > self.drawTopTree(p) > > File "c:\leo.repo\leo-editor\leo\plugins\qt_tree.py", line 635, in > drawTopTree > apply_deletes(deletes) > > File "c:\leo.repo\leo-editor\leo\plugins\qt_tree.py", line 596, in > apply_deletes > v2i[vch].remove(chitem) > > ValueError: list.remove(x): x not in list > > Edward >
The tree-refresh branch is not finished and some operations like this one doesn't work. But the essence of the applied algorithm is correct. It basically creates a set of all links that exist in the outline. Links are represented by tuples (parent_v, child_v, index). The set can be calculated very fast and using python set operations difference on the set cached during the previous redraw and the current set, gives a set of links that need to be deleted and set of links that need to be established. This algorithm must be adjusted a bit to work with the prototype but it is doable. The undo/redo code in the prototype relies on preserving the tree items while the algorithm in its current version drops the items and create new ones. Other than that it should work without problems. If undo/redo code in the prototype is not required this limitation on preserving the tree items can be lifted. Vitalije -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/71efcfe8-687c-45eb-ba6f-83f97001e410%40googlegroups.com.