Intellij Idea and auto formatting : spaces
Asked Answered
P

3

5

I noticed Intellij Idea auto formatting removes spaces from blank lines. In an example below spaces are shown with "_"

__line1
__
__line3

And idea makes that:

__line1

__line3

How can I turn that off? It prevents using subversion.

Push answered 1/7, 2014 at 13:28 Comment(0)
S
10

This is found under:

  • Windows: File > Settings > Editor > General > Strip trailing spaces on Save
  • MacOS: IntelliJ IDEA > Preferences > Editor > General > Strip trailing spaces on Save

IntelliJ gives you the ability to search in the Preferences dialog. You can narrow down the list of options by searching for "trailing", for example.

Strip trailing spaces on Save Dialog

Seamy answered 2/7, 2014 at 16:42 Comment(2)
@PhilipRego, the settings/preferences are going to be in slightly different locations depending on your OS.Seamy
2021 update. Now it's a checkbox. On a sidenote, this only works on save, not on reformat.Electromotive
S
3

IntelliJ IDEA 15

File > Settings... > Editor > General > Strip trailing spaces on Save: None

Strip Trailing spaces

Striking answered 1/2, 2016 at 14:50 Comment(0)
N
0

In newer version of IntelliJ the setting is named: Remove trailing spaces on

enter image description here

You can also hit key sets: Ctrl + Shift + A and type:

Remove trailing spaces on

It will bring you to this dialog:

enter image description here

anf after you click it you will be autmaticaly redirected to the settings page.

Neuron answered 23/4 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.