Closed mathias-lang-sociomantic closed 9 years ago
The same problem exists for debug
statements:
debug (A)
{
}
else debug (B)
{
}
else
{
}
The syntactic analysis that determines how code to be indented is built into the cc-mode engine and doesn't allow customization, i.e. addition of custom syntactic clauses. To fix this issues it is necessary either to reimplement the syntactic analysis for D mode, or to add D mode to the built-in languages of cc-mode.
Pull request duly committed. I didn't get chance to test it out fully, but took the small risk and committed it anyway. We can always back out if problems arise.
According to the specs, the following code:
Should have the last
else
indented at the same level asversion (SomeOtherVersion)
.However, one common idiom is the following:
Which basically allow us to use
version
asif
. would it been possible to get both (bug fixed whenversion
is on a newline after anelse
, and right alignment of braces when we haveelse version
) ?