When reformatting a file, phpstorm replaces empty lines with whitespace to just empty lines, e.g. ^[tab][tab]$
to ^$
. How do I disable this?
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 hasModified Lines
option)
but apparently it only works on "Save".
Related tickets:
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)
.blade.php
files, but enable it for all other files (including index.php etc.) ? –
Aldos .editorconfig
file (it has standard option fir such stuff) & enabled EditorConfig support in IDE settings -- yes, that should work fine (even on per file level, if configured properly). NOTE: When enabled, settings from .editorconfig
override IDE settings. –
Disproportion I find solution in opposite topic: Configure editor to remove whitespaces in blank lines.
It works in WebStorm, and should work in PHPStorm as well:
Settings | Editor | Code Style | PHP | Tabs and Indents (tab) | Keep Indents on Empty Lines" (check box)
© 2022 - 2024 — McMap. All rights reserved.
diff
has an option to ignore whitespace differences. Doesn'tgit diff
allow you to use that option? – Broomstick