Fix delimeters only for schema in the workspace
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java
index 6387961..d6c73cc 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -127,7 +127,13 @@
writer.flush();
swriter.close();
String content = swriter.toString();
- content = AbstractModel.fixLineDelimiter(content, (IFile) ((IModel) getModel()).getUnderlyingResource());
+
+ if (getInput() instanceof IFileEditorInput) {
+ // If we are working with a file in the workspace, correct line delimeters based on workspace/file settings
+ IFile file = ((IFileEditorInput) getInput()).getFile();
+ content = AbstractModel.fixLineDelimiter(content, file);
+ }
+
doc.set(content);
} catch (IOException e) {
PDEPlugin.logException(e);