eclipsemacosaptana

Copy and paste in Eclipse adds window newlines at the end of each pasted line


I am using Eclipse (Version: Indigo Service Release 2) on Mac OS X (10.7) with PHP Development Tools and Aptana Studio 3 Plugin.

In Preferences > General > Workspace I have selected: - Text file encoding = UTF-8 - New text file line delimiter = Unix In Preferences > General > Editors > Text Editors I have enabled "Show whitespace characters".

I also use "File > Convert Line Delimiters To > Unix" to regularly change any windows newlines.

Copy-paste of text adds windows newlines (^M) characters at the end of whole lines in the pasted text. This happens despite the fact that the text copied is "clean" of Windows new line characters. This happens for all copy-pasted text (from the same file/editor, or from other sources) if it has at least one whole line in it. I noticed the behavior in git commits.

I believe I have exhausted all possible explanations and did not find anything in my research.

I suspect the Aptana Plugin is the problem because I have a second (separate) installation of Eclipse with all set as above minus the Aptana plugin and never experienced something similar. Nevertheless I can not find anything in Aptana preferences that would look like a potential solution.

Any ideas before I call this a bug?


Solution

  • I had exactly the same annoying problem. After some research and experimentation I think I found the source of the bug and a workaround.

    Observations on my set up (Eclipse 3.7.2, PDT 3.0.0, no aptana):

    This behavior felt like an issue with automatic indentation handling, so I tried dis-/enabling indentation related options. Disabling the following option fixed it for me:

    PHP > Editor > Typing > When pasting adjust indentation

    good luck