Re: [code] Python folding pretty broken

From: Parke <parke.nexus.att.gmail.com>
Date: Mon, 23 Feb 2015 09:25:54 -0800

On Mon, Feb 23, 2015 at 9:10 AM, Carlos Pita <carlosjosepita.att.gmail.com> wrote:
>> Attached is my "text outline" folder (which is actually a Lexer). It
>> folds based purely on whitespace indentation.
>
> Thank you very much. Anyway, I feel the fold.by.indentation approach
> is good to have at the scintillua level, many languages would benefit
> from this general strategy out of the box. Other editors, notoriously
> vim, do have it in their toolboxes. It's just that blank lines
> shouldn't be taken to start new top level folds. I'm not even sure
> whether there should be an option for this or not, I can't figure out
> a sensible use case for the current behavior.

Based on what I remember from December...

The Scintilla folding API provides the current line to the folder.
Scintilla assumes the folder will not need to look backwards at
previous lines to do folding.

This may be why blank lines are assumed to be top level folds.

My outline folder scans backwards to see lines that Scintilla does not
provide. I think Mitchell recommended against this, but I saw no
other solution.

It would be interesting to look at the SciTE Python lexer/folder (if
there is one) and see how it works.

Back on December 10, off list, Parke wrote:
> Not that I care about Python and CoffeeScript (at least at present),
> but I believe Python allows blank lines between Header and Body. And
> also within Body.

And Mitchell responded:
> True, but I don't think this is very common.

I did not press the point at that time, as I already knew I needed
more than fold.by.indentation was providing.

-Parke

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 23 Feb 2015 - 12:25:54 EST

This archive was generated by hypermail 2.2.0 : Tue 24 Feb 2015 - 06:43:38 EST