[Geany-Users] Code Folding

Matthew Brush mbrush at xxxxx
Wed Apr 24 23:22:07 UTC 2013


On 13-04-24 10:58 AM, Josh Nijenhuis wrote:
> Docs
> "Code folding
>      Allow groups of lines in a document to be collapsed for easier
> navigation/editing.
> Fold/Unfold all children of a fold point
>      Whether to fold/unfold all child fold points when a parent line is
> folded."
>
>
> I have code like this everywhere
>      if ($this==0) {
>          warn "hello";
>      } else  {
>          warn "bye";
>      }
>
> But when I collapse the if statement the else get collapsed too, but if
> I do this
>
>      if ($this==0) {
>          warn "hello";
>      }
>      else  {
>          warn "bye";
>      }
>
> it works,
>
> any suggestions? beside reformatting? can geany support my code layout?
>

I know it's at least supported by the Scintilla editor widget Geany 
uses[1]. You could try to set it in a `filetypes.<language>` file as per 
the manual[2]. I think it would look something like this:

     [lexer_properties]
     ...
     fold.at.else = true
     ...

Cheers,
Matthew Brush

[1] 
https://github.com/geany/geany/blob/master/scintilla/lexers/LexCPP.cxx#L303
[2] http://www.geany.org/manual/current/index.html#lexer-properties-section

> Thanks
>
> Josh
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list