Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347314 - [client] Sometimes LF is used for line breaks when I expected CR+LF
Summary: [client] Sometimes LF is used for line breaks when I expected CR+LF
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-26 09:25 EDT by Mark Macdonald CLA
Modified: 2011-09-01 11:43 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2011-05-26 09:25:24 EDT
Chrome 12.0.742.60 beta-m
Windows 7

I have not figured out the exact steps to recreate this, but I see it quite often.

1. I'm editing a JS file that uses CR+LF to indicate newlines.
2. I add/delete lines, copy, paste, etc.
3. At some point, I look at my file in the WebKit debugger. I see that some lines I was editing are using LF rather than CRLF. The debugger displays these as a single line. So its line numbers don't match the Orion editor.


I mostly see this with closing curly braces of blocks, eg:
>        }
>    }
displays as
>    }    }
Comment 1 Silenio Quarti CLA 2011-05-26 09:49:56 EDT
I have seen this happen, but I was editing the file on a Linux or Mac client and running the server on Windows.  The editor always uses the client line delimiter, which is wrong.
Comment 2 Mark Macdonald CLA 2011-05-26 10:24:39 EDT
(In reply to comment #1)
> I have seen this happen, but I was editing the file on a Linux or Mac client
> and running the server on Windows.  The editor always uses the client line
> delimiter, which is wrong.

If the editor running in a Windows browser will only do CR+LF, then maybe I'm getting myself into this state using Git somehow.
Comment 3 Mark Macdonald CLA 2011-06-09 20:38:41 EDT
I finally figured out what causes this. 

Using Chrome 12 on Windows:

1. Open the editor, put the caret somewhere
2. Press Shift+Enter.
3. Save.
4. Look at the file in Eclipse. You'll see that LF was inserted in step 2, not the platform delimiter (CR+LF).
Comment 4 Felipe Heidrich CLA 2011-06-10 10:59:06 EDT
fixed
http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=1657eb956dad825b9813466f521048ae47aa00e5

mark please pull the latest and double check the fix.
on my machine, shift+enter was causing funny problems (in the demo.html at least), the lines were not being inserted in the model, so scrolling up and down was causing the lines enter via shift+enter to dissappear.
Comment 5 Mark Macdonald CLA 2011-06-10 11:41:22 EDT
(In reply to comment #4)
> mark please pull the latest and double check the fix.
Works great, thanks