PhpStorm removes whitespaces on its own - phpstorm

Problem Description:
I change something in my code, but PhpStorm removes all the unnecessary whitespaces at the end from several lines, where i havent worked on.
What i tried:
In Preferences > Editor > General, i deactivated the Option "Remove trailing spaces on:…" in the "On Save" Section
Result: not worked. PhpStorm still removes unnecessary whitespaces
Does someone know, how to fix that?

Related

Prevent double-indent

What's the code style setting to prevent PhpStorm from adding an extra indentation level when pasting arrays from clipboard?
The most obvious (continuation indent) does not seem to be the one:
It's Editor/ General/ Smart Keys/ Reformat on paste:
Setting it to Indent Block appears to fix the issue while keeping the auto-format feature working.

Sublime Text 3: How do I stop flagrantly incorrect tab suggestions?

Where in my settings is autocomplete failing to decipher what it's suggesting? This is obviously syntactically incorrect, I'm inside the quotes for a tag and it's suggesting more tags.
Example:
This is due to the way Sublime Text scopes work. Autocompletion is based on the scope of the character immediately to the right of the caret when there is no selection. In your example, it is the " character. It therefore doesn't see that the caret is actually inside the style attribute, because it sees CSS as only what is between the quotes, and not the quotes themselves. Therefore, it suggests other attribute names.
The workaround is simply to ensure there is a space between where you are typing and the closing " character of the attribute value.
EDIT: I have now suggested a fix for this in a PR to the SublimeText Default Packages repo. If it gets accepted, it will be available in the next ST3 build. Alternatively, you can follow the instructions in the repo's Readme to grab the changes sooner.
EDIT: and another PR to make the same fix when typing just before the </style> tag.

Automatically unindent closing HTML tags in PyCharm

I have toggled every option that seems to make sense and have searched for an hour, but I can't find a solution. I'm sure I'm just missing some magic word, and the solution is probably simple, but how do you make PyCharm automatically unindent closing HTML tags?
For example, if I type:
<div>
Test
</
PyCharm will automatically fill in the div>, but it will leave the indent hanging.
Thanks in advance.
Update: Part of the reason why I was particularly annoyed by this problem was that I was unable to backspace to the appropriate indent level before typing the closing tag, so to put the tag on the correct level, I had to Shift+Tab or press Home then Backspace.
I found this answer that pointed me to Settings -> Editor -> General -> Smart Keys, where I set Backspace -> Unindent to To nearest indent position, instead of To proper indent position, which dramatically reduced the annoyance level of the original issue.
I'll leave this open, as automatically unindenting closing tags (or automatically setting them to the "proper indent position") would still be the most ideal solution.
PyCharm automatically adds the closing tag when you type the starting tag. So when i type <div> there will be </div> directly added.

PhpStorm - remove empty lines from end of file

At the moment I'm testing PhpStorm IDE. It is really great, except one feature. It doesn't remove empty lines from end of file. It's now remove unneeded whitespaces, but empty lines at the end aren't removed.
It's really annoying for me. Can I change this behaviour?
Not currently possible. Please vote for IDEA-119281

Sublime Text 2 highlighting always disabled on trailing spaces plugin

In Sublime Text 2 I have installed the trailing spaces plugin, however the highlighting is always set to disabled.
if I toggle the highlight regions, by doing the following:
edit -> trailing spaces -> highlight regions
I always get the following:
highlighting of trailing spaces is disabled!
I have restarted sublime since the package install, but the toggle doesn't seem to work, does anyone know how to fix this issue?
Work around fix - not the solution to the problem
As for others it seems, i couldn't seem to get this trailing spaces to highlight no matter what i did, so what i did was remove the trailing spaces automatically on save. Not ideal but used to it now, works nicely.
Go to SublimeText 2 > Preferences > User Settings (or just hit the Mac Standard cmd + ,). This should open your User Settings as a JSON file. Add the following to your file
"trim_trailing_white_space_on_save": true
That's it. You're good to go.
I had this problem in Sublime Text 3.
I fixed it by deleting my trailing_spaces.sublime-settings file in the Sublime Text user package settings folder (which for me was %APPDATA%\Sublime Text 3\Packages\User) and reinstalling the plugin.
Some more discussion about this issue can be found on the plugin GitHub page here.
It's a known bug - see their Issues page on GitHub.
I was able to get it working by starting Sublime with a non-blank string value for the setting trailing_spaces_highlight_color
Open Preferences > Package Settings > Trailing Spaces > Settings - User
Replace:
"trailing_spaces_highlight_color": ""
With:
"trailing_spaces_highlight_color": "invalid"
Restart Sublime.
Edit > Trailing Spaces > Highlight Regions should work as expected now.
If you restart Sublime, "trailing_spaces_highlight_color" must not be a blank string, otherwise it will stop working again. Repeat the steps above to fix.
As long as Sublime is started with a non-blank string value for trailing_spaces_highlight_color, the toggle highlight regions works.
It looks like the plugin is caching the value in the setting file when Sublime loads. If you make changes to the settings file and toggle highlighting, the original value is restored. Which is why you need to restart Sublime for setting changes to take effect.