On Wednesday, August 7, 2013 3:37:51 PM UTC-5, Terry wrote:
>
> c.deletePositionsInList(c.vnode2allPositions(p.v))
>
Yes, I think this should work. (not tested!)
**Important**: My first thought was that the following would work:
c.deletePositionsInList([p.v])
But in fact, this will not have the same effect. Indeed, the *business
end* of c.deletePositionsInList is::
for p in aList2:
v = p.v
parent_v = p.stack[-1][0] if p.stack else c.hiddenRootNode
if v in parent_v.children:
childIndex = parent_v.children.index(v)
if trace: g.trace('deleting',parent_v,childIndex,v)
v._cutLink(childIndex,parent_v)
else:
if trace: g.trace('already deleted',parent_v,v)
In other words, c.deletePositionsInList is *both* position oriented *and*
vnode oriented. The method uses v._cutLink to do the actual deletes, but
it *also* does::
parent_v = p.stack[-1][0]
to get each parent vnode. Thus, positions *are* essential (hence the name
of the method), even though the low-level work is done using only vnodes.
So I learned something today ;-)
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.