2072 / PHP-Indenting-for-VIm

The official VIm indent script for PHP
http://www.2072productions.com/to/phpindent.txt
128 stars 29 forks source link

Wrong indent on nested switch with if #32

Closed doits closed 10 years ago

doits commented 10 years ago

Refs #6:

When an if-statement follows the nested switch, indention get's wrong like this:

<?
switch($a) {
case 'a':
    switch($aa) {
    case 'aa':
        break;
    }

    if( $c ) { 
    }
    break;
    case 'b': # <-- indention wrong
        break;
}

Without the if( $c ) { } it gets it right, or when the closing bracket of the if is on the same line.

2072 commented 10 years ago

This should be fixed

doits commented 10 years ago

thanks for the quick fix!