End of line character
Hi,
I have problem with end of line character. I have changed some lines in this file. Git diff command shows me that the end of file characters were changed in lines I've edited. The end of line characters changed from unix to windows-like. I'm using PhpStorm build 107.120 on Ubuntu.
Where can I change end of line characters used in my project?
Best regards,
Wojtek
请先登录再写评论。
Hi Wojtek,
Please try File | Settings | Code Style | General --> Line Separator
But as far as I know it is for new files only (files created by PhpStorm)...
To actually change the line endings -- try Search | Replace and use regular expressions -- such approach does work in most IDEs/TextEditors I have used (have not tried myself in PhpStorm though).
EDIT:
Tried that Search | Replace suggestion myself -- does not work in PhpStorm, sorry :(
Hi,
Thanks for fast reply, but:
Unfortunatelly it really seems to work with new files only.
PhpStorm can't find "\r\n" (with regex turned on, of course) in my file...
Any other ideas?
Only 1 idea (which may be a bit messy -- depending on how many of such files you need to "fix"):
Create another file in PhpStorm and copy-paste text from old file, then delete original & rename newly created file to original filename.
I just tested it and it worked fine
Hmmm ... double post
In any case -- you still can use your local text editor (gedit, if I'm not mistaken, or whatever other text ediotr you may have there) -- it may be able to perform such regex replace operations.
I have to use another text editor, as you say, because that copy-content-trick doesn't work fully as I suspect, because git teat it as a new content (probably because PhpStorm converts spaces into tabs or sth like this during pasting the code).
Thanks for support :)
Hi Wojtek,
Please vote for this ticket (if you are registered at Issue Tracker) to have such functionality implemented in PhpStorm:
http://youtrack.jetbrains.net/issue/WI-3820
Thnx