awfun
awfun

Reputation: 2488

Intellij Idea and auto formatting : spaces

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.

Upvotes: 5

Views: 10375

Answers (3)

fascynacja
fascynacja

Reputation: 2816

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.

Upvotes: 0

kuporific
kuporific

Reputation: 10322

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

Upvotes: 10

ROMANIA_engineer
ROMANIA_engineer

Reputation: 56616

IntelliJ IDEA 15

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

Strip Trailing spaces

Upvotes: 3

Related Questions