Smart indent broken?

Using phpStorm 2018.3.4 and Smart Indenting works up to a point, I just cannot work out why it thinks this is appropriate:

<?php
function expected()
{
if ($test1)
if ($test2)
if ($test3)
if ($test4)
if ($test5)
$test6 = true;

// press enter, expected caret position
}

function actual()
{
if ($test1)
if ($test2)
if ($test3)
if ($test4)
if ($test5)
$test6 = true;

// press enter, actual caret position
}

Interestingly, the Reformat Code option corrects the indentation, but surely that's what Smart Indenting should be doing?

1 comment
Comment actions Permalink

Please submit this to our issue tracker, I wasn't able to find an existing issue for that: https://youtrack.jetbrains.com/newIssue?project=WI

0

Please sign in to leave a comment.