On Fri, 2 Jan 2009 06:49:17 -0600
"Edward K. Ream" <[email protected]> wrote:

> The fix is on the trunk at rev 1374.  All unit tests pass, including
> two new unit tests for c.positionExists.  However, this is a major
> bug fix--as described below this change has the potential to cause
> subtle problems. Please take care, and please report any further
> problems immediately.

=== modified file 'leo/core/leoCommands.py'
--- leo/core/leoCommands.py     2008-11-21 16:43:33 +0000
+++ leo/core/leoCommands.py     2009-01-02 12:32:18 +0000
@@ -6928,7 +6928,11 @@
             if p == root:
                 return True
             if p.hasParent():
+                v = p.v
                 p.moveToParent()
+                # Major bug fix: 2009/1/2
+                if v not in p.v.t.children:
+                    return False
             else:
                 p.moveToBack()

to be absolutely correct I think that the index of the position (or is
it the vnode?) in the list of children needs to be the same.  The above
seems to allow for the position to exist, but not in the same, um,
position.  p._childIndex is not checked, in other words.

Of course, if you fix it (which you probably should) I'll have to use
my one positionExists() code for caching positions, as it's better to
find that the position still exists and update the index (i.e. search
self_and_siblings_iter), than to search the whole tree again for a
position containing a particular vnode.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to