textmate/php.tmbundle — Issue #19: switch statement not auto-indented correctly
Author: ZevEisenberg
Created: 2011-12-16 16:20:11+00:00
State: open

When you declare a `switch` statement with `switch[tab]`, the template looks like this:

```php
switch (variable) {
case 'value':
# code...
break;

default:
# code...
break;
}
```

The code below the `case` and `default` is indented. However, when I try to add a new case by pressing `return` at the end of the first `break;`, everything stays indented one more to the right than the first case:

```php
switch (variable) {
case 'value':
echo 'hello';
break;
case 2:
echo 'hello';
break;

default:
echo 'hello';
break;
}
```

When I use `Command`-`Option`-`[` to Indent Line / Section, most of the statement gets flattened and doesn't match the template:

```php
switch (variable) {
case 'value':
echo 'hello';
break;
case 2:
echo 'hello';
break;

default:
echo 'hello';
break;
}
```

I would like the auto-indent to make it look like this:

```php
switch (variable) {
case 'value':
echo 'hello';
break;
case 2:
echo 'hello';
break;

default:
echo 'hello';
break;
}
```