[Lazarus] region [elastic tabs [Re: Auto indentation]]

Martin lazarus at mfriebe.de
Fri Nov 6 05:34:14 CET 2009


Hans-Peter Diettrich wrote:
> Martin schrieb:
>
>> For section heading {%region} {%endregion} is usefull => since it 
>> allows folding
>
> Such verbose formatting is unusable, for several reasons:
> - it is bound to an special editor
> - it is imposed on every user
> - it must be maintained manually
> - it is pure overhead
>
So what did you mean, what are your ideas of folding?

There are many possibilities, but most of them will be supported by very 
few editors, if any at all.

A few ideas I had, but not all worth doing:

- language specific folds (begin/end or open/close tags in xml) => 
existing for pascal

- temporary folds: not bound to any content. They exist as long as the 
editor is open, (and would be a poor substitute for having 2 windows of 
the same content)
  They would work, by selecting any amount of lines, and fold them

- folding any paragraph, (defined by at least one empty line in-between

- folding by level of indent

- folding by special comments (as you indicated "///") but that again is 
very editor specific. it is just a shorter notion of region.
  It could be configurable by specifing the pattern / and it has the 
advance of an automatic end at the next section / and they could be 
leveled ("///", "////", "/////", ...)


The "///" are what you mentioned in your post. But (with the exception 
maybe of overhead) it has the same properties as region:
- it is bound to an special editor
  (or a set of a few special editors)
- it is imposed on every user
 (if it is not treated as editor specific directive it is a comment; so 
is {%region ...} )
- it must be maintained manually
 (except for the end of each block is found automatically, sometimes an 
advantage, sometimes a disadvantage)





More information about the Lazarus mailing list