PHPStorm reformat - how do I disable removing spaces in empty lines?

phpstorm, reformat

Solution

You cannot -- http://youtrack.jetbrains.com/issue/IDEA-73161

I was thinking that disabling stripping whitespace characters altogether would do the job:

By changing `Settings | Editor | Strip trailing spaces on Save` (which nowadays has `Modified Lines` option)

but apparently it only works on "Save".

Related tickets:

- http://youtrack.jetbrains.com/issue/IDEA-99173

Now you can do that on code reformat as well:

- `Settings/Preferences`

- `Editor | Code Style`

- `$language$ | Tabs and Indents | Keep indents on empty lines` check box

(this option was introduced after this answer was provided: https://youtrack.jetbrains.com/issue/IDEA-103941#comment=27-807213)

Problem

When reformatting a file, phpstorm replaces empty lines with whitespace to just empty lines, e.g. `^[tab][tab]$` to `^$`. How do I disable this?

Original source