Thanks! пн, 7 дек. 2020 г., 18:36 Edward K. Ream <[email protected]>:
> > > On Mon, Dec 7, 2020 at 1:11 AM Alexey Tikhonov <[email protected]> > wrote: > >> Hello! >> >> I'm trying to make a script which would replace a selected node in the >> outline with the node's "shell copy". The new node should have the same >> header and body as the original one with all children cloned. After >> creating the new node the original position should be deleted - and that >> does not work. Could you, please, give me a hint where an error is? >> > > My guess is that the culprit is: > > shell_copy = p.insertBefore() > > Oops. This invalidates position p! > > Instead, the safe way is to create the new node *after* p. Now position p > remains valid. > > Edward > > -- > You received this message because you are subscribed to a topic in the > Google Groups "leo-editor" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/leo-editor/oAaO_35AfC8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/leo-editor/CAMF8tS1eyprTAoHYzG9A1XXUUL8yFsfVXJ_w-W7jC84seKVW_Q%40mail.gmail.com > <https://groups.google.com/d/msgid/leo-editor/CAMF8tS1eyprTAoHYzG9A1XXUUL8yFsfVXJ_w-W7jC84seKVW_Q%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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAJEUK_tL4%3DLcEOkUjs6GPR8UF6Z9jokcRqO4KvMxfqkct6wbmg%40mail.gmail.com.
