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;
}
}
if (computed != null)
indent = computed.toString();
else
- indent = new String();
+ //indent = new String();
+ return true; // prevent affecting html part
}
// change document: