I have a couple annoyances regarding these features and how I'd like it if they worked together... but currently do not.
When I type
The right bracket is completed and then after I hit enter I get the following
function doSomething() {
}
|
The cursor has the right bracket stuck to the side of it. Not really stuck but as I type it will always be there to the right until I arrow away from it. If I leave it as is and type another bracketed structure I'll get this:
function doSomething() {
if (TRUE) {
}}
|
When I get stuck next to a bracket I correct the issue by hitting return, arrowing up once and hitting tab twice. It is annoying to have to repeat this sequence each and every time I start a new block of code.
What I would like to happen is the following when I write a auto-completed bracket and then hit enter is:
function doSomething() {
| // <- cursor
}
// or
function doSomething() {
if (TRUE) {
| // <- cursor
}
}
|
Basically to have the smart indent and auto-close bracket features work together to correctly indent me and place the closing bracket indented properly on the line below the cursor when creating a new block of code. I could even live with it happening with parentheses as well since I commonly write large array structures like so:
$arr = array(
'cat' => 'meow',
'dog' => 'woof',
'complex' => array(
'foo' => 'bar',
'bar' => 'foo',
),
);
|
Can this please happen?