Made the project/module files to be written with the same separators they've been read in.

This commit is contained in:
Maxim Shafirov
2005-01-14 16:22:03 +03:00
parent 208904b167
commit 24adda710a
2 changed files with 5 additions and 1 deletions
@@ -315,7 +315,7 @@ public class FileDocumentManagerImpl extends FileDocumentManager implements Appl
}
public String getLineSeparator(VirtualFile file, Project project) {
String lineSeparator = file.getUserData(DETECTED_LINE_SEPARATOR_KEY);
String lineSeparator = file != null ? file.getUserData(DETECTED_LINE_SEPARATOR_KEY) : null;
if (lineSeparator == null) {
CodeStyleSettingsManager settingsManager = project == null
? CodeStyleSettingsManager.getInstance()
@@ -62,6 +62,10 @@ public class JDOMUtil {
return w1.toString().equals(w2.toString());
}
public static Document loadDocument(char[] chars, int length) throws IOException, JDOMException {
SAXBuilder builder = createBuilder();
return builder.build(new CharArrayReader(chars, 0, length));
}
public static Document loadDocument(File file) throws JDOMException, IOException {
SAXBuilder saxBuilder = createBuilder();