The RubyMine version 2016.2.1 not work Strip trailing spaces on Save
已完成
The RubyMine version 2016.2.1 not work Strip trailing spaces on Save
. I think this worked with pre version.
My Preferences
My Code
the code have unnecessary only white lines.
How to remove the only white lines? is this RubyMine bug?
请先登录再写评论。
Hello,
I didn't manage to reproduce the problem. Do those lines remain if you do File | Save All?
It also doesn't work for me after updating to 2016.2.2. I am using Intellij IDEA Ultimate 2016.2
@Do Nguyen,
did you try File | Save All?
@Olga Kuvardina
What do you mean `File | Save All`?
Same for me after updating to 2012.2.1. I am using RubyMine.
Upon save, only the trailing space in the lines that already contain some text is trimmed. If the line only contains spaces (e.g. the empty line between two Ruby methods) it does not get trimmed. This is really annoying... I loved this feature.
Please note that this behaviour is irrelevant to the "Allow placement of the caret after the end of line", which affects the trimming behaviour of the line under the caret. I am not referring to this.
@Shingo Nakanishi
I mean the operation of manual save (by going to File | Save all).
@Ilias
Just to be sure - are those empty lines trimmed in case of manual save or switching to another application? If so then please specify what behaviour you'd expect instead.
@olga nope, they are not trimmed in case of manual save. Same applies for switching to another file (or application), when autosave is enabled. It used to work just fine in both cases. So, I would expect that all the spaces in the empty lines, which I edited*, that would be fully trimmed.
*depends on the relevant setting in the Preferences, as the screenshot at the top of this thread shows.
@Ilias please provide screenshots from Settings | Editor | General and also from Settings | Editor | Code Style | Ruby (if we were talking about Ruby or another language if not)
Hello Olga,
While I was attempting to make the screenshots you asked, I found the cause of the problem. The checkbox in Settings > Editor > Code Style > Ruby > Keep indents on empty lines was checked! I unchecked, tested the editor and it seems just fine :-)
Having said that, I believe that this setting was somehow changed itself while installing one of last 2-3 versions with bugfixes. I never changed this myself. I rarely mess with my Ruby settings in RubyMine as I have been working with the same settings for years now.
Thanks,
Ilias
@ILIAS SPYROPOULOS
@Olga Kuvardina
OH! My RubyMine was same. `Ruby > Keep indents on empty lines was checked!`.
unchecked it, then work. thanks.
@ILIAS SPYROPOULOS
It's quite strange, in my case it remained unchecked (after updating to the last version)