doon
doon

Reputation: 2361

Does eclipse on windows add Control M characters

I am trying to determine if Eclipse on Windows add control-M characters. I have not seen any setting for it in Preferences->Text Editors. If I don't see Control M characters using vi -b on Linux, can I conclude that control-M characters are not present when using eclipse on Windows?

Upvotes: 14

Views: 17260

Answers (2)

Jinesh Mathew
Jinesh Mathew

Reputation: 366

You can change line delimiters for all existing files for a project by selecting the project and got to File-->Convert Line Delimiters To-->Unix.

This will modify line delimiter for all files under the project. This will solve the issue.

Upvotes: 11

mliebelt
mliebelt

Reputation: 15525

I finally found under Window > Preferences > General > Workspace the next text file line delimiter preference. Default is the delimiter of the OS you are using Eclipse on, but you can change that.

Preference for text file line delimiter

That means that when you now change a file (coming from Linux) under Windows, and you have not changed the default, the line end convention (of the existing file) will be kept (New text file line delimiter), but if you create a new file, the convention of your current OS (Windows) will be used.

Upvotes: 18

Related Questions