+3

PHP Alternate Control Syntax Wrongly Indent

Corey Worrell 7 years ago updated by Alex van der Vegt 7 years ago 1
When using PHP's `if`, `foreach`, etc. alternate syntax, the closing line is unindented one tab after typing.

This is intended behavior if I am indented inside the control structure, but if I unindent before typing it out, then it should recognize that and not unindent itself.
    <?php foreach ($items as $item): ?>
        Something here
    <?php endforeach ?>
    // Turns into this after typing closing '>'
    <?php foreach ($items as $item): ?>
        Something else
<?php endforeach ?>

I am also facing this issue very annoying when coding wordpress or magento code. Any solution for this? It seems a small bug to fix for the Sublime team?