On Sun, 6 Dec 2009 15:09:02 -0600 Terry Brown <[email protected]> wrote:
> Ok, pushed code to check for that. But still the correct answer is > for v to grow a .doDelete() method, I'll post a bug report for that. Turns out to be this is really complicated. I decided v.deleteFromParent() was pretty simple, (apart from sibling clones) and went down that route. But ug - undo works with positions, not vnodes, so I implemented c.vnode2allPositions(), based on c.vnode2position(). Not really *all* positions, but one position for each immediate parent. That's what the code uses now, and it just deletes sibling clones arbitrarily. It no longer sometimes fails to attempt to delete the correct non-sibling clone, because it now gets all positions, not just one. I'm not sure there's an easy fix for the sibling clone thing, because you'd have to track the child-index of each node, but that's subject to getting changed as the deletions are happening, i.e. the original problem with positions. Can't say I really like clones, not using them myself. I know what they can be used for, but then backlinks.py gives similar functionality which is more fragile (a minus), but doesn't convolute the tree so much (a plus). Anyway, I think contextmenu delete is in pretty good shape now. Cheers -Terry -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.
