8

Having 2 lines with trailing spaces and cursor at the end of the 2nd one, on save action only trailing spaces from 1st line will be striped.

I mean, if I have this:

1st_line[space]
2nd_line[space][cursor]

after save action I will have

1st_line
2nd_line[space][cursor]

Is it possible to also strip the line with cursor?

(It can be a philosophical question - Is space in the 2nd line really trailing or not? Though there is cursor behind it)

Vektor
  • 560
  • 4
  • 15
kuba
  • 3,670
  • 3
  • 31
  • 41
  • *"Is it possible? to strip also line with cursor?"* -- No, it's intentional (requested by users), otherwise it will also remove indentation when cursor is on new empty line and you plan to continue typing after save operation is done. – LazyOne Oct 29 '13 at 14:12
  • Why not customize this? I have a habit to save after finishing some part, not before starting next. This is not huge problem, but introduces possibility to make a mistake. – kuba Oct 29 '13 at 14:38
  • The Issue Tracker where you can leave your suggestions in form of **concrete** ideas is located here: http://youtrack.jetbrains.com/issues/WI . P.S. I personally do not think that such option will be introduced. – LazyOne Oct 29 '13 at 16:10

2 Answers2

6

You can vote of this feature request:

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
5

Disable (uncheck) the option "Always keep trailing spaces on caret line" under Settings|Editor|General|Other|Strip trailing spaces on Save.

Taken from the issue-link @CrazyCoder provided in his answer. It is included since PHP Storm version 2016.3.2.

Andru
  • 5,954
  • 3
  • 39
  • 56