vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Remove unneeded space(lead to trailing space) when insert multi new lines

Open ik0r opened this issue 10 years ago • 4 comments

  • VSCode Version: 0.10.11
  • OS Version: OS X 10.11.2 Steps to Reproduce:

If I have these image

Then I insert multi new lines. because Code auto indent, so I get multi trailing space. image

The expected output is below image

In Sublime Text, if I insert multi new line, only current line will have trailing space. like this

image

ik0r avatar Mar 24 '16 08:03 ik0r

@Treri For that there is a setting to remove trailing whitespace on save

jrieken avatar Mar 24 '16 08:03 jrieken

@jrieken Yeah, I know this setting.

But Suppose we are editing a very simple markdown file. Two trailing space will make a new line(will create a <br /> tag). If we set Code to remove trailing space on save, the wanted trailing spaces will also be removed.

ik0r avatar Mar 24 '16 09:03 ik0r

@jrieken this usually is not want you want, as people will start hating you for that.

Assume that you are working with legacy code, where a lot of trailing spaces left, or maybe you have plenty folks on the team who do not care about left spaces. Also imagine that you are modifying Nk lines file. If you will kill all trailing spaces at once - you will cause a lot of confusion in git blame, plus people will start to hate you for a lot of merge conflicts.

outcoldman avatar Apr 17 '16 01:04 outcoldman

Thanks to @outcoldman this has now landed with PR #5423 . It will most likely come out with the May release in about a month.

alexdima avatar May 03 '16 15:05 alexdima