On Wed, 26 Nov 2014 22:38:43 -0800
Matt Wilkie <[email protected]> wrote:

> ...Later: The pattern seems to be that any file I open from the
> command line, opens off-screen, while starting Leo with no params and
> then opening with File menu is ok. Weird.
> 
> No, that's not it. It gets even weirder. Opens off-screen:
> B:\>leo \code\apt-dev.leo
> B:\>leo code\apt-dev.leo  
> 
> Opens on-screen!
> B:\>leo b:\code\apt-dev.leo  

I thin c.db entry look ups are based on a hash of the path, so
\code\apt-dev.leo probably gets stripped to code\apt-dev.leo for
hashing maybe, or they're otherwise both canonicalized to the same
path, giving the same hash.  b:\code\apt-dev.leo would have a 
different hash.

So certainly a surprising behavior, but I think that's why.

c.db.keys()

[u'_leo_bookmarks_show',
 u'body_outline_ratio_fcache/a9fba9a184e7d1620a7366d620766655',
 u'body_outline_ratio_fcache/4eb1e969b18082d7addfd86b2c666436',
 u'body_outline_ratio_fcache/8d6ffa6f34e6420f58a25f5f69a71838',
  # from a time when c had a different path?
 u'current_position_fcache/a9fba9a184e7d1620a7366d620766655',
 u'current_position_fcache/4eb1e969b18082d7addfd86b2c666436',
 u'tabulanotes',
 u'fcache/fb3264c1ab88e79eba54d9624d385d19',
 u'fcache/5e28f4e297a810e80eeb0623a99e51dc',
 (and many more - these are @<file> caches)
 u'_graph_canvas_gnx',
 u'_ns_layout',
 u'body_secondary_ratio_fcache/a9fba9a184e7d1620a7366d620766655',
 u'body_secondary_ratio_fcache/4eb1e969b18082d7addfd86b2c666436',
 u'body_secondary_ratio_fcache/8d6ffa6f34e6420f58a25f5f69a71838',
 u'window_position_fcache/a9fba9a184e7d1620a7366d620766655',
 u'window_position_fcache/4eb1e969b18082d7addfd86b2c666436',
 u'window_position_fcache/8d6ffa6f34e6420f58a25f5f69a71838',
 u'_plugin_bookmarks']

so...

for k in c.db.keys():
    if k.split('/')[0] in (
        "window_position_fcache",
        "body_secondary_ratio_fcache", 
        "body_outline_ratio_fcache",
        "current_position_fcache",
    ):
        del c.db[k]

Cheers -Terry

-- 
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/d/optout.

Reply via email to