Emacs-D-Mode-Maintainers / Emacs-D-Mode

An Emacs mode for D code.
GNU General Public License v3.0
84 stars 22 forks source link

Wrong indentation for `static if` ... `else static if` #79

Closed mathias-lang-sociomantic closed 8 years ago

mathias-lang-sociomantic commented 8 years ago

Just upgraded Emacs-D-Mode, so presumably using 98af62e67026fee1dda9155e1a463917fc83802e

void main ()
{
    static if (is(Object))
    {

    }
    else static if (is(Typoe))
         {
         }
}

As you can see, the brackets are too indented.

CyberShadow commented 8 years ago

Hmm, doesn't happen here. We now even have an actual test for this: https://github.com/Emacs-D-Mode-Maintainers/Emacs-D-Mode/blob/master/tests/I0039.d#L48-L56

What do you get without any c-offsets-alist customizations?

mathias-lang-sociomantic commented 8 years ago

Hum, emacs 24.3.1 (which as I just read, you're not supporting fully). I just upgraded to Emacs 26 and that fixed it :+1:

CyberShadow commented 8 years ago

Note that indentation for 24.3 and below has been broken since June. Perhaps the change reached you only now because no one has been updating the version header until a few days ago.

mathias-lang-sociomantic commented 8 years ago

It was broken for a long time for me, and was extremely annoying, but I didn't bother reporting it because the project was not actively maintained :)