Fixed: 1345914 - indentation badly wanted
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / actions / IndentAction.java
index 44cfdb5..ce26e9b 100644 (file)
@@ -277,39 +277,40 @@ public class IndentAction extends TextEditorAction {
                                        to++;
                                indent = command.text.substring(1, to);
 
-                       } else if (!fIsTabAction && partition.getOffset() == offset
-                                       && type.equals(IPHPPartitions.PHP_SINGLELINE_COMMENT)) {
-
-                               // line comment starting at position 0 -> indent inside
-                               int slashes = 2;
-                               while (slashes < document.getLength() - 1
-                                               && document.get(offset + slashes, 2).equals("//")) //$NON-NLS-1$
-                                       slashes += 2;
-
-                               wsStart = offset + slashes;
-
-                               StringBuffer computed = indenter.computeIndentation(offset);
-                               int tabSize = PHPeclipsePlugin
-                                               .getDefault()
-                                               .getPreferenceStore()
-                                               .getInt(
-                                                               AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
-                               while (slashes > 0 && computed.length() > 0) {
-                                       char c = computed.charAt(0);
-                                       if (c == '\t')
-                                               if (slashes > tabSize)
-                                                       slashes -= tabSize;
-                                               else
-                                                       break;
-                                       else if (c == ' ')
-                                               slashes--;
-                                       else
-                                               break;
-
-                                       computed.deleteCharAt(0);
-                               }
-
-                               indent = document.get(offset, wsStart - offset) + computed;
+// omit Java style
+//                     } else if (!fIsTabAction && partition.getOffset() == offset
+//                                     && type.equals(IPHPPartitions.PHP_SINGLELINE_COMMENT)) {
+//
+//                             // line comment starting at position 0 -> indent inside
+//                             int slashes = 2;
+//                             while (slashes < document.getLength() - 1
+//                                             && document.get(offset + slashes, 2).equals("//")) //$NON-NLS-1$
+//                                     slashes += 2;
+//
+//                             wsStart = offset + slashes;
+//
+//                             StringBuffer computed = indenter.computeIndentation(offset);
+//                             int tabSize = PHPeclipsePlugin
+//                                             .getDefault()
+//                                             .getPreferenceStore()
+//                                             .getInt(
+//                                                             AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
+//                             while (slashes > 0 && computed.length() > 0) {
+//                                     char c = computed.charAt(0);
+//                                     if (c == '\t')
+//                                             if (slashes > tabSize)
+//                                                     slashes -= tabSize;
+//                                             else
+//                                                     break;
+//                                     else if (c == ' ')
+//                                             slashes--;
+//                                     else
+//                                             break;
+//
+//                                     computed.deleteCharAt(0);
+//                             }
+//
+//                             indent = document.get(offset, wsStart - offset) + computed;
 
                        }
                }
@@ -320,7 +321,8 @@ public class IndentAction extends TextEditorAction {
                        if (computed != null)
                                indent = computed.toString();
                        else
-                               indent = new String();
+                               //indent = new String();
+                               return true; // prevent affecting html part
                }
 
                // change document: