On Wed, 16 Jun 2010 08:08:21 -0500 "Edward K. Ream" <[email protected]> wrote:
> On Wed, Jun 16, 2010 at 6:44 AM, Kent Tenney <[email protected]> wrote: > > >> I short: I think it would be nice if users would have a custom option > >> to control the logic of code splitting > > This is an interesting topic. More flexibility would be good, imo. > The question is, how to get it? > > Because we are talking about @auto, we can't make many assumptions > about coding style: that's up to the original authors of the code. > > We could consider per-file options that say, in effect, I want *this* > file formatted like *this*. These options can be cached if we > continue to assume that can't alter the files themselves. > Alternatively, a leo-editor line, similar to a vim line, could specify > options. Such lines aren't odious. I can't see why it's so complicated. Firstly, @decorators - mentioning these first to get them out of the way, they belong in the same node as the following def. Cases like this: # add inspection @inspector(log_file, debug) # also enable tracing @trace # now define foo def foo(self): ... might take a little care, but basically once you start seeing decorators you start storing lines in the node of the next def. In the obnoxious example above, if the comment about the first decorator got separated, I don't think that would be the end of the world, until python implements `import understand_human_language` there are going to be edge cases. So, @decorators aside, Leo has to decide where to put non-blank lines which occur between defs. Leo's already making that decision, so to me it's just a matter of a @setting to let the user decide whether it's `preceding_node`, `following_node`, or `own_node`. I'd want the same approach applied to all files I load with @auto. Maybe I'm missing something. 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.
