aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2013-03-05 23:56:37 (EST)
committerzzhongwei2013-03-06 00:14:54 (EST)
commit489a8b68d8c32b7ccf2ea8a5319495b0fd6c4598 (patch)
tree4b951d0b0370bcb221f557b73ec479085b63de14
parentfff8de220bd1996c9aeabb48bdc3ac4831cb07ef (diff)
downloadorg.eclipse.pdt-489a8b68d8c32b7ccf2ea8a5319495b0fd6c4598.zip
org.eclipse.pdt-489a8b68d8c32b7ccf2ea8a5319495b0fd6c4598.tar.gz
org.eclipse.pdt-489a8b68d8c32b7ccf2ea8a5319495b0fd6c4598.tar.bz2
383839: Unix Line Delimiter Ignored When Pasting
https://bugs.eclipse.org/bugs/show_bug.cgi?id=383839
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/PHPAutoIndentStrategy.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/PHPAutoIndentStrategy.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/PHPAutoIndentStrategy.java
index 9f5a822..7c11bbf 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/PHPAutoIndentStrategy.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/autoEdit/PHPAutoIndentStrategy.java
@@ -171,7 +171,12 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
StringBuffer sb = new StringBuffer();
for (int i = 0; i < startingEmptyLines; i++) {
- sb.append(newline);
+ String lineDelimiter = newline;
+ try {
+ lineDelimiter = tempdocument.getLineDelimiter(i);
+ } catch (BadLocationException e) {
+ }
+ sb.append(lineDelimiter);
}
for (int i = 0; i < list.size(); i++) {
if (!formatter.getIgnoreLines().contains(i + 1)) {
@@ -180,7 +185,13 @@ public class PHPAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
sb.append(list.get(i));
if (i == list.size() - 1) {
} else {
- sb.append(newline);
+ String lineDelimiter = newline;
+ try {
+ lineDelimiter = tempdocument
+ .getLineDelimiter(startingEmptyLines + i);
+ } catch (BadLocationException e) {
+ }
+ sb.append(lineDelimiter);
}
}