#62 Switch Statement and Tertiary Operator Indentation Bug

closed-out-of-date
Indentation (6)
5
2008-11-04
2008-08-08
Anonymous
No

The following indentation is produced incorrectly:

switch($a) {
case "blah":
$text = ($a) ? "fast" : "slow";
callAnotherFunc(); // should be indented
break; // should be indented
default:

}

I believe the colon in the tertiary operator causes an indentation reset to the case-label level when used with the colon after "slow";

Discussion

  • Works for me. What version of Emacs and CC-mode do you use?

     
    • status: open --> open-remind
     
    • labels: --> Indentation
    • assigned_to: nobody --> ashawley
    • status: open-remind --> closed-out-of-date
     
  • Your request applied to an older version of PHP mode, so we do not have the resources to properly respond to it.

    Feel free to resubmit your request should it still apply to to a newer version of PHP mode.

    Regards,
    The PHP mode maintainers