Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356701

Summary: PHP Editor Rendered Unusable When Editing Files With Unix-Style Line Endings
Product: z_Archived Reporter: Anthony Reyes <xeorem>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: critical    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Eclipse errors generated when the bug is reproduced none

Description Anthony Reyes CLA 2011-09-04 23:46:31 EDT
Created attachment 202730 [details]
Eclipse errors generated when the bug is reproduced

Occurs with version 3.0.0v20110516-110-77 from Indigo Available Software Repository (http://download.eclipse.org/releases/indigo).
Occurs with a fresh installation of Eclipse Classic with only PDT installed.

When editing a php file with unix-style line endings, the editor becomes unusable. Newly typed characters are not inserted where they should be and upon clicking, several lines of code appear to be spontaneously reproduced or deleted.

Steps for Reproduction:

1) Open any PHP file with Unix-style line endings. Alternatively, open any PHP file and convert line-endings to Unix-style (File->Convert Line Delimiters To->Unix). Make sure the file is not empty and has at least one newline in it or Eclipse will automatically assume Windows style endings for you.

2) Find (or add) any PHP tag on its own line.

3) Move cursor to beginning of PHP tag and press Return to move it down a line

4) Move cursor to empty line above the PHP tag and try to open a new tag by typing the less-than character (it will not show up).

5) Proceed to edit the file. The bug should be reproduced now.

Notes: I have not found a way to circumvent this bug. Even if I add multiple newlines beforehand before starting the new tag, the bug is reproduced. I tried reproducing the error with Eclipse's default text editor and could not; it must be a PDT problem. I have included the eclipse error logs for further detail.
Comment 1 Anthony Reyes CLA 2011-09-05 13:36:23 EDT
Can be circumvented by setting Eclipse to show all whitespace characters (including line end delimiters), converting to CRLF  before editing a file with LF line-endings and converting back to LF when done editing. Assigning keyboard shortcuts to the conversions helps.

Suggest downgrading priority from "Blocker" to "Critical". This is not to imply that the bug is not severe but that it can be circumvented.
Comment 2 Anthony Reyes CLA 2011-09-15 13:58:13 EDT

*** This bug has been marked as a duplicate of bug 325981 ***