fixed Bug 1024299
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / java / JavaStringAutoIndentStrategy.java
index 319980b..ea00344 100644 (file)
@@ -53,12 +53,12 @@ public class JavaStringAutoIndentStrategy extends DefaultAutoIndentStrategy {
                                        token = tokenizer.nextToken();
                                        if (token.equals("\n")) { //$NON-NLS-1$
                                                buffer.append("\\n"); //$NON-NLS-1$
-                                               buffer.append("\" + " + delimiter); //$NON-NLS-1$
+                                               buffer.append("\" . " + delimiter); //$NON-NLS-1$
                                                buffer.append(indentation);
                                                buffer.append("\""); //$NON-NLS-1$
                                                continue;
                                        } else {
-                                               buffer.append("\" + " + delimiter); //$NON-NLS-1$
+                                               buffer.append("\" . " + delimiter); //$NON-NLS-1$
                                                buffer.append(indentation);
                                                buffer.append("\""); //$NON-NLS-1$
                                        }
@@ -67,7 +67,7 @@ public class JavaStringAutoIndentStrategy extends DefaultAutoIndentStrategy {
                                }
                        } else if (token.equals("\n")) { //$NON-NLS-1$
                                buffer.append("\\n"); //$NON-NLS-1$
-                               buffer.append("\" + " + delimiter); //$NON-NLS-1$
+                               buffer.append("\" . " + delimiter); //$NON-NLS-1$
                                buffer.append(indentation);
                                buffer.append("\""); //$NON-NLS-1$
                                continue;
@@ -147,7 +147,7 @@ public class JavaStringAutoIndentStrategy extends DefaultAutoIndentStrategy {
 
        private void javaStringIndentAfterNewLine(IDocument document, DocumentCommand command) throws BadLocationException {
 
-               ITypedRegion partition= TextUtilities.getPartition(document, fPartitioning, command.offset);
+               ITypedRegion partition= TextUtilities.getPartition(document, fPartitioning, command.offset, false);
                int offset= partition.getOffset();
                int length= partition.getLength();
 
@@ -170,7 +170,7 @@ public class JavaStringAutoIndentStrategy extends DefaultAutoIndentStrategy {
                
                IPreferenceStore preferenceStore= PHPeclipsePlugin.getDefault().getPreferenceStore();
                if (isLineDelimiter(document, command.text))
-                       command.text= "\" +" + command.text + indentation + "\"";  //$NON-NLS-1$//$NON-NLS-2$
+                       command.text= "\" ." + command.text + indentation + "\"";  //$NON-NLS-1$//$NON-NLS-2$
                else if (command.text.length() > 1 && preferenceStore.getBoolean(PreferenceConstants.EDITOR_ESCAPE_STRINGS))
                        command.text= getModifiedText(command.text, indentation, delimiter);            
        }