The problem is that it's a heavy mix of PHP + HTML (lots of ?> <?php blocks) that happening inside PHP functions (the later is important nuance)...
In you file you have a lot of "PHP code ?> HTML CODE <?php PHP code again" sections ... -- if I remove ALL of them .. and even copy-paste all remaining lines few times .. it's still gets reformatted.
Few suggestions:
1) Do not do that (if it's your code) -- better use echo "HTML HERE"; or HEREDOCS like
//bla-bla php code echo <<<HTML HTML EHRE HTML; // php code again
I've tried converting one of the functions ( bornholm_show_seperator() ) into such form (while removed such HTML+PHP mix in other places, of course) .. and reformat still worked.
2) Submit a bug ticket to the Issue Tracker -- I have no clue how long it will take devs to fix it -- quite possible that such complex case (of such "nasty" (as for my liking) style) will be put into some deep drawer.
Hi there,
Settings/Preferences | Editor | Code Style | HTML | Other --> "or if tag size more than" -- try inceasing that/setting new value.
Hi Andriy,
thanke for your answer!
I have tried to set the value to 2.000 but it didn't work ... It's a PHP file.
I do not know any similar setting for PHP...
1) Your PhpStorm version?
2) Exact file name?
I use PhpStorm 9.0.2 and the file name is functions.php.
I have created a Gist with it's content: https://gist.github.com/FlorianBrinkmann/c9d89f7d9bcdb50d05af
Thanks for the file!
It's not a problem with number of lines ...
The problem is that it's a heavy mix of PHP + HTML (lots of ?> <?php blocks) that happening inside PHP functions (the later is important nuance)...
In you file you have a lot of "PHP code ?> HTML CODE <?php PHP code again" sections ... -- if I remove ALL of them .. and even copy-paste all remaining lines few times .. it's still gets reformatted.
Few suggestions:
1) Do not do that (if it's your code) -- better use echo "HTML HERE"; or HEREDOCS like
or
I've tried converting one of the functions ( bornholm_show_seperator() ) into such form (while removed such HTML+PHP mix in other places, of course) .. and reformat still worked.
2) Submit a bug ticket to the Issue Tracker -- I have no clue how long it will take devs to fix it -- quite possible that such complex case (of such "nasty" (as for my liking) style) will be put into some deep drawer.
Yes, it's my code :) Thanks for your time and the solution for my problem, I'll have a look at it.