I've just pushed these changes, unit tests pass.

Cheers -Terry

revno: 4569
committer: Terry Brown <[email protected]>
branch nick: trunk
timestamp: Mon 2011-10-10 12:33:05 -0500
message:
  handle escaping in UNLs, add p.get_UNL, show file part of unl in statusline
diff:
=== modified file 'leo/core/leoFrame.py'
--- leo/core/leoFrame.py        2011-10-03 19:06:37 +0000
+++ leo/core/leoFrame.py        2011-10-10 17:33:05 +0000
@@ -2516,8 +2516,7 @@
 
         # what UNL.py used to do
         c.frame.clearStatusLine()
-        c.frame.putStatusLine("-->".join(reversed(
-            [i.h for i in p.self_and_parents()])))
+        c.frame.putStatusLine(p.get_UNL())
 
         g.doHook("select2",c=c,new_p=p,old_p=old_p,new_v=p,old_v=old_p)
         g.doHook("select3",c=c,new_p=p,old_p=old_p,new_v=p,old_v=old_p)

=== modified file 'leo/core/leoGlobals.py'
--- leo/core/leoGlobals.py      2011-10-10 14:52:06 +0000
+++ leo/core/leoGlobals.py      2011-10-10 17:33:05 +0000
@@ -2021,11 +2021,11 @@
         c.expandAllAncestors(p) # 2009/11/07
         c.selectPosition(p)
         c.redraw()
-        c.frame.bringToFront()  # doesn't seem to work
+        c.frame.bringToFront()
 
     if depth == 0:
         nds = c.rootPosition().self_and_siblings()
-        unlList = [i for i in unlList if i.strip()]
+        unlList = [i.replace('--%3E', '-->') for i in unlList if i.strip()]
         # drop empty parts so "-->node name" works
     else:
         nds = p.children()

=== modified file 'leo/core/leoNodes.py'
--- leo/core/leoNodes.py        2011-10-08 12:32:49 +0000
+++ leo/core/leoNodes.py        2011-10-10 17:33:05 +0000
@@ -529,6 +529,18 @@
     # New in Leo 4.4.3:
     hasVisBack = visBack
     hasVisNext = visNext
+    #@+node:tbrown.20111010104549.26758: *4* get_UNL
+    def get_UNL(self, with_file=True):
+        
+        UNL = '-->'.join(reversed([
+            i.h.replace('-->', '--%3E')
+            for i in self.self_and_parents()
+        ]))  
+
+        if with_file:
+            return "%s#%s" % (self.v.context.fileName(), UNL)
+        else:
+            return UNL
     #@+node:ekr.20080416161551.192: *4* p.hasX
     def hasBack(self):
         p = self

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