I just updated to PhpStorm 2016 and I noticed that suddenly every time I press Ctrl + S to save the file it removes the spaces/tabs that I pressed to continue writing after testing this bit of code.
Pleas help, this is very annoying for me, since I save my file after every line of code.
Here is a screenshot when I'm about to save, so after hitting Ctrl + S the text cursor will move all the way to the left, deleting all spaces & tabs.
I recently experienced the behavior that trailing spaces got removed everywhere although the option Settings/Preferences > Editor > General > Strip trailing spaces on Save
was set to Modified Lines
. Setting the option to None
didn't help nigher.
The reason for that was, that I had installed the JetBrains IDE plugin EditorConfig. In the root of my (PHP-) project I had a
.editorconfig file with the setting trim_trailing_whitespace = true
. Setting that to false, fixed the issue.
You need to disable Settings/Preferences | Editor | General | Remove trailing spaces on:
option.
(NOTE: in older IDE versions you may have just a drop down box and have to select the None
option there)
P.S. Please note that if you have .editorconfig
files in your project then corresponding setting from there (trim_trailing_whitespace
) will overwrite such IDE setting. It is expected as it's the whole nature of such files.
If you do not like that then either edit your .editorconfig
file accordingly (https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#current-universal-properties) or disable such support in the IDE (Settings/Preferences | Editor | Code Style | Enable EditorConfig support
)
PhpStorm 2021.2.3
Just Settings/Preferences > Editor > General
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With