Configurable code formatting (Indentation + brace position)

This commit is contained in:
Jindra Pet��k
2014-02-25 15:52:41 +01:00
parent 856765011c
commit 1e3a67ec1c
36 changed files with 623 additions and 578 deletions
+3 -3
View File
@@ -220,7 +220,7 @@ public class Helper {
Scanner scanner = new Scanner(text);
String indentStr = "";
for (int i = 0; i < level; i++) {
indentStr += HilightedTextWriter.INDENT_STRING;
indentStr += Configuration.getCodeFormatting().indentString;
}
int indentLength = indentStr.length();
for (int i = 0; i < prefixLineCount; i++) {
@@ -229,7 +229,7 @@ public class Helper {
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (line.startsWith(indentStr)) {
sb.append(line.substring(indentLength)).append(HilightedTextWriter.NEW_LINE);
sb.append(line.substring(indentLength)).append(Configuration.getCodeFormatting().newLineChars);
} else {
return sb.toString();
}
@@ -706,7 +706,7 @@ public class Helper {
}
public static String byteArrayToHex(byte[] data, int bytesPerRow) {
HilightedTextWriter writer = new HilightedTextWriter(false);
HilightedTextWriter writer = new HilightedTextWriter(Configuration.getCodeFormatting(),false);
byteArrayToHex(writer, data, bytesPerRow, 8, true, true);
return writer.toString();
}