I added undo code to the ftlist code I shared in another thread (the code
with undo implemented is here:
https://gist.github.com/btheado/ca898b8b24b84ba08b3f26f61441cc41).

The undo operations are working fine, but redo is giving me an assertion
error.

It isn't clear to me what Position p are supposed to be passed into the
undoer beforeXXX and afterXXX methods. Cloning and moving nodes are the
only operations I have. For move, I assume I should be passing the position
which is/was moved for both before and after. For clone, should I be
passing the original before and the clone after?

My next step if I get a chance tomorrow will be to remove all of the
operations but one to see if I can get undo/redo to work for a simpler case
and then try to build up from there. I'm open to other ideas.

Here is the assertion error I'm getting on redo:

Traceback (most recent call last):

  File "/home/btheado/src/leo-editor/leo/core/leoGlobals.py", line 296, in
new_cmd_wrapper
    func(self, event=event)

  File "/home/btheado/src/leo-editor/leo/core/leoUndo.py", line 1176, in
redo
    u.redoHelper()

  File "/home/btheado/src/leo-editor/leo/core/leoUndo.py", line 1284, in
redoGroup
    z.redoHelper(); count += 1

  File "/home/btheado/src/leo-editor/leo/core/leoUndo.py", line 1346, in
redoMove
    assert u.oldParent_v.children[u.oldN] == v


AssertionError


Brian

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAO5X8CzE5ztevPnO6cD2%3DgLtpnaGh0OsnFC%2BEDP8uOkrYW6H%2Bw%40mail.gmail.com.

Reply via email to