Couldn't a paste-as-template just traverse the tree and make new clones where they already are clones and just copy as new nodes everywhere else?
Might it be an easy enough rule to say that: a) pasting a whole tree as a clone makes the tree a clone at the topmost node (and would turn the source tree's topmost node into a clone if it isn't already) (what's currently implemented) b) whereas pasting a whole tree as a template doesn't make any nodes into brand new clones (topmost or below); it just clones what's already a clone below the topmost node? Isn't it the case that clones are really just the same node represented on screen in different places at the same time, with pointers from different places in the data structure? I could be wrong, but seems like for paste-as-template only clones become new clones in the new template tree, and so there won't be any need to keep track of any effects of dependencies on source nodes in the original tree. An original tree clone node would revert to regular clone only when you delete the last cloned instance somewhere else. But that's already built in, happens every time you delete anything. You can even add to or prune individual template trees willy-nilly that were identical to each other when they were originally pasted-as-template. Seth On 5/27/20, vitalije <[email protected]> wrote: > I am rather busy ATM so I can't help much with this. Personally I have felt > (more than once) a need for this kind of command in the past. It is hard to > make a simple rule that this command should follow to decide which nodes to > clone and which nodes to copy. Whatever rule we decide on, it will lead to > ambiguous situations when tree changes between copy and paste command. > > Perhaps this can be simplified to this command: > `paste-retaining-marked-nodes`. User can mark nodes that are to be > retaining identity after paste. All other nodes should have new identities > after paste. I guess this would be trivial to implement and user would have > full power over the effect of the command. > > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAJkfFByR9KP3mKcqzh9jGbTybRrfmJuC2n4BG9L6Kjmrx9uDRA%40mail.gmail.com.
