Re: bug in JSON scanner?
On Sun, Mar 10, 2019 at 10:34 AM Josef wrote: > Hi Edward > > well, after saving the @auto file the node gets restored next time, but > the content of the file is not what you see in the node (body), but a > special JSON file, which describes the node, it's children, even the uA's > etc. Such a file is of course useless when I want to edit an arbitrary JSON > file. > I suggest using either @clean or @edit. 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 leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: bug in JSON scanner?
Hi Edward well, after saving the @auto file the node gets restored next time, but the content of the file is not what you see in the node (body), but a special JSON file, which describes the node, it's children, even the uA's etc. Such a file is of course useless when I want to edit an arbitrary JSON file. For me the workaround is to use @clean instead of @auto. But I still have to use your workaround the first time I open an externally generated JSON file, otherwise Leo refuses to read the file. Alternatively I can read any file, also JSON with @edit and later change to @clean, however my default @file setting (in active_path) is @clean, and that fails. Also, there seems to be no @language json I think the leo_json.py plugin should not use @auto (and @clean ...) in this way, because this behaviour is very different from the way @auto works for other languages, where the external file can be any ordinary Python, C, Lua, ... file. Rather, leo_json.py should use different directives, to make the difference clear. At the same time, I wish Leo would be able to read and write generic JSON files, including syntax highlighting. - Josef -- 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+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: bug in JSON scanner?
On Friday, March 8, 2019 at 6:23:45 AM UTC-6, Edward K. Ream wrote: On Thu, Mar 7, 2019 at 11:01 AM Josef wrote: > >> I can't load the simplest JSON file into Leo... >> > At present, Leo's json scanner only handles .json files that Leo itself wrote. That is, the scanner can only read files written by the leo/plugins/writers/leo_json.py plugin. You could say this makes sense, because the reader is going to try to recreate a tree of nodes from the .json file, and this file is assumed to be a dict with certain keys. So for now the workaround is to copy your .json text into one or more Leo nodes in an @auto x.json file. Leo will read the file correctly when you restart the file, as I have just verified. 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 leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
Re: bug in JSON scanner?
On Thu, Mar 7, 2019 at 11:01 AM Josef wrote: > I can't load the simplest JSON file into Leo, I always get an error message > ... > Thanks for this report. I have just created #1098 for this. 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 leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.