From YangFan:
> I'm using version 1.73, and find that Ruby lexer could not get correct
indent information when fetch 'else' token. I hope 'else' should have
the same fold level as 'if' and 'end', but in fact not. Is it a bug or
not ?

I designed it that way.  Let's imagine Ruby used braces (although it
doesn't).  An "{" on a line increases the indentation level for the
next line.  A "}" decrements it.  At the start of a line you have
indentation level I[1].  At the end of the line you have indentation
level I[1] + k * (count(open-brace) - count(close-brace)).  The drawback
with this approach is you can't fold the individual components of
an if-elsif-elsif...-else-end block easily.  The advantage is you
can easily fold an entire if ... end block.

The lexer uses the keywords instead of braces, but the result is
the same.

'def', 'module', 'class', 'if', 'while', 'until', and a few
others increase I (be sure not to include things like 'if' in
<<statement if expression>>).

'end' always decreases it.

'else', 'elsif', and 'when' are neutral.

This is why you are seeing 'else' take the same indentation level
as the body of the if-block.

- Eric

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to