Reputation: 859
Here is a screenshot of what's happening to my wordpresss template code time after time:
https://www.box.net/shared/zrql76wiimr790587yxj
I thought at first it was a notepad++ problem. But this occured also on phpstorm.
Any idea why that's happening?
Upvotes: 0
Views: 123
Reputation: 10696
Your code isn't messed up, this is a question about how your system handles lineendings.
Linux and OSX save lineendings differently from Windows.
Linux and OSX saves lineendings with a Line Feed
(LF):
\n
While windows saves it with Carriage Return + Line Feed
(CR+LF):
\r\n
So what is probably happening is that your file has been written on a system that doesn't save lineendings in the windows format. Your editor most probably supports these kind of line endings and can handle it, look into the menus of your editor.
** Below is part of an edit and not part of my answer.**
You can check EditorConfig which can be helpful when you are trying to keep settings across projects and/or editors and also, if you keep your code under git, Dealing with line endings article from Github may be also helpful.
End of edit
Read more here: Wiki article
Upvotes: 2