I think the issue is in u.redoGroup (leo/core/LeoPyRef.leo#Code-->Core
classes-->@file leoUndo.py-->class Undoer-->u.redo helpers-->u.redoGroup)

The line:
    bunch = u.beads[*u.bead*]; count = 0

Should be:
    bunch = u.beads[*u.bead+1*]; count = 0

That line is in both u.undoGroup and u.redoGroup. For undoGroup u.bead is
valid, but for redo it should be operating with u.bead+1.

Brian


On Sun, Aug 18, 2019 at 5:18 PM Brian Theado <brian.the...@gmail.com> wrote:

> Hmm, it didn't work for me. Using your code and following the same steps
> as my original email, I get the same error message.
>
> After that if I start from step #4 (the ctrl-b step) again, then the undo
> and the redo work. But then if I start again at step #4, I get the original
> error message again.
>
> Could you confirm it is working for you even starting from scratch?
>
> On Sun, Aug 18, 2019 at 9:32 AM Edward K. Ream <edream...@gmail.com>
> wrote:
>
>>
>>
>> On Sun, Aug 18, 2019 at 8:28 AM Edward K. Ream <edream...@gmail.com>
>> wrote:
>>
>>>
>>> On Sun, Aug 18, 2019 at 8:24 AM Edward K. Ream <edream...@gmail.com>
>>> wrote:
>>>
>>> At least one problem is that p changes after:
>>>
>>>     child = parent.insertAsNthChild(0)
>>>
>>
>> This works:
>>
>> groupType = 'insert child twice'
>> undoType = 'insert first child twice'; u = c.undoer
>> # Start group.
>> parent = p.parent()
>> u.beforeChangeGroup(parent, groupType)
>> # 1
>> undoData = u.beforeInsertNode(parent)
>> child = parent.insertAsNthChild(0)
>> u.afterInsertNode(child, undoType, undoData)
>> # 2
>> undoData = u.beforeInsertNode(parent)
>> child = parent.insertAsNthChild(0)
>> u.afterInsertNode(child, undoType, undoData)
>> # End group.
>> u.afterChangeGroup(parent, groupType)
>> c.redraw(child)
>>
>> This fails if p.parent() does not exist, but that's another matter.
>>
>> Also note the two different undo types.  That's probably not necessary,
>> but it's better style.
>>
>> Edward
>>
>> --
>> 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/CAMF8tS1RaaS8qumebOtNLaT%3DLVpx_kajWcTjjQUGfnV8LuW3Ng%40mail.gmail.com
>> <https://groups.google.com/d/msgid/leo-editor/CAMF8tS1RaaS8qumebOtNLaT%3DLVpx_kajWcTjjQUGfnV8LuW3Ng%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/CAO5X8Cw75Pu9UjwwCwRnrzzC8QhNQ5mgpy-Bg8Jm9x15bvuSFA%40mail.gmail.com.

Reply via email to