Bug 123287 - [misc] convert line delimiters on save
Summary: [misc] convert line delimiters on save
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 195063
Blocks:
  Show dependency tree
 
Reported: 2006-01-10 13:27 EST by Amy Wu CLA
Modified: 2019-09-06 16:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amy Wu CLA 2006-01-10 13:27:39 EST
It would be nice if there was an option to convert line delimiters when a file is saved.  For example, what happens now if user inserts a template that spans multiple lines?  Are the line delimiters automatically converted to whatever the user specified in the preference?  Or what if line delimiters are inserted programatically elsewhere?  There is no guarantee that the preferred line delimiter will be used.
Comment 1 Dani Megert CLA 2006-01-11 11:07:20 EST
Such an option would make sense. See also bug 6749, bug 22742 and bug 41320.

>Are the line delimiters automatically converted to whatever
>the user specified in the preference?
No, there's no auto-conversion since an IDocument can handle mixed line delimiters and it's speced that clients decided whether to honour this:
 * An <code>IDocument</code> does not care about mixed line delimiters. Clients who
 * want to ensure a single line delimiter in their document should use the line
 * delimiter returned by {@link org.eclipse.jface.text.TextUtilities#getDefaultLineDelimiter(IDocument)}.

>Or what if line delimiters are inserted
>programatically elsewhere? There is no guarantee that the preferred line
>delimiter will be used.
Yes, as outlined above (Javadoc of IDocument) it's up to the programmer to decide whether to use the document's default line delimiter or not. Of course we or clients could create a document that enforces modifications to only contain the default line delimiter but this limitation is not required from a text framework point of view.
Comment 2 Dani Megert CLA 2006-10-26 12:26:16 EDT
We could add a clean up but that would only work for Java files.
Comment 3 Eclipse Webmaster CLA 2019-09-06 16:11:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.