0

I want to make a PR for phaser.io however when i want to commit the file there seems to be changes in all the empty block comment lines. Since there are actually whitespaces in the original file i tried to deactivate the "Strip trailing whitespaces" option in Webstorm but it did not change a thing.

original file original file

Anyone of you know how to prevent Webstorm from doing this? I haven't found anything on google yet.

EDIT: I changed the git screenshot to a clean one without new line changes.

James Skemp
  • 8,018
  • 9
  • 64
  • 107
Cryt1c
  • 97
  • 1
  • 1
  • 11
  • Unfortunately not. I have edited the original question, since I am now sure that Webstorm just deletes those whitespaces in the block comment's empty lines. – Cryt1c Apr 20 '17 at 20:32
  • When you deactivated the "strip trailing whitespace" option, did you reset the file to its original state? – jakub.g Apr 20 '17 at 20:36
  • yes i reverted it – Cryt1c Apr 20 '17 at 20:36
  • BTW looking at the diff, there seems to be more changes that just this trailing whitespace removal highlighted in red, probably newlines are also changed (LF <-> CRLF), check this answer: http://stackoverflow.com/q/3920650/245966 – jakub.g Apr 20 '17 at 20:43
  • you are right. i have tried around with the different newlines too. did not fix it though – Cryt1c Apr 20 '17 at 20:46
  • I am not sure, but guess that webstorm and phpstorm works similar in this aspect, you may check the answers at https://stackoverflow.com/q/40962197/880188 ... – LarS Jun 05 '18 at 18:46
  • ... as I can see there is a [.editorconfig](https://github.com/photonstorm/phaser/blob/master/.editorconfig) file, make sure to check my answer there too: https://stackoverflow.com/a/50688530/880188 – LarS Jun 05 '18 at 18:50

1 Answers1

0

People on the Jetbrains boards are talking about this feature. It sounds like settings at a language level can override the general setting: ie if strip whitespace is turned on in TypeScript (??), that will take precedence over the general setting.

(Disclaimer: Haven't tried it myself)

RyanWilcox
  • 13,890
  • 1
  • 36
  • 60
  • Thanks for the recommendation. I tried to do this: Default Settings >> Editor >> Code Style >> Typescript >> Tabs and Indents (tab) >> "Keep Indents on Empty Lines" and also this: 'Always keep trailing space on caret line' Both did not change anything. – Cryt1c Apr 21 '17 at 08:38