Community
Participate
Working Groups
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.
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.
We could add a clean up but that would only work for Java files.
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.