bug filed: https://bugs.launchpad.net/leo-editor/+bug/1184855
It doesn't have anything to do with file extensions. The deciding metric seems to be: files which have valid leo sentinels are safe, e.g. the output of "@file something", while those that do not have sentinels will be wiped on save. I'm pretty sure this is newish. There was a conversation last year(?) about using Leo to quickly edit any old file. -matt On Mon, May 27, 2013 at 5:26 PM, gatesphere <[email protected]> wrote: > High priority bug report in order. Thanks for the tip. > -->Jake > > > On 5/27/2013 6:55 PM, Matt Wilkie wrote: > >> ...just a quick note of warning, no time to expand right now: opening >> a file to edit on the command line with >> >> leo \path\to\my-cool-thing.ext >> >> will save in the leo xml file format AS AN EMPTY FILE, throwing away >> whatever else you had in there. I presume because the file type is >> unrecognized, so defaults to leo. >> >> To reproduce: >> >> 1. copy foobar.py to foobar.pyxxx >> 2. run "leo foobar.pyxxx" >> 3. save >> 4. view foobar.pyxxx in another text editor or whatever. >> >> BEFORE >> {{{ >> Z:\Tools> head foobar.pyxxx >> # -*- coding: utf-8 -*- >> >> import contextlib >> import os >> import sys >> >> import arcpy >> >> # You can ignore/delete this code; these are basic utility functions to >> # streamline porting >> }}} >> >> >> AFTER: >> {{{ >> <?xml version="1.0" encoding="utf-8"?> >> <!-- Created by Leo >> (http://webpages.charter.net/**edreamleo/front.html<http://webpages.charter.net/edreamleo/front.html>) >> --> >> <?xml-stylesheet ekr_test?> >> <leo_file >> xmlns:leo="http://www.leo-**editor.org/2011/leo<http://www.leo-editor.org/2011/leo>" >> > >> <leo_header file_format="2" tnodes="0" max_tnode_index="0" >> clone_windows="0"/> >> <globals body_outline_ratio="0.5" body_secondary_ratio="0.5"> >> <global_window_position top="50" left="50" height="500" >> width="700"/> >> <global_log_window_position top="0" left="0" height="0" >> width="0"/> >> </globals> >> <preferences/> >> }}} >> >> >> Leo Log Window >> Leo 4.11 devel, build 5784, 2013-05-26 01:15:45 >> Python 2.7.4, qt version 4.7.1 >> Windows 6, 1, 7601, 2, Service Pack 1 >> leoID=maphew (in C:\Users\mhwilkie\dropbox\.**leo) >> load dir: B:\apps\leo\leo-editor\leo\**core >> global config dir: B:\apps\leo\leo-editor\leo\**config >> home dir: C:\Users\mhwilkie\dropbox >> reading settings in B:\apps\leo\leo-editor\leo\**config\leoSettings.leo >> docutils loaded >> reading settings in C:\Users\mhwilkie\dropbox\.**leo\myLeoSettings.leo >> >> > -- > 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 > leo-editor+unsubscribe@**googlegroups.com<leo-editor%[email protected]> > . > To post to this group, send email to [email protected]. > Visit this group at > http://groups.google.com/**group/leo-editor?hl=en-US<http://groups.google.com/group/leo-editor?hl=en-US> > . > For more options, visit > https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> > . > > > -- 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?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
