mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 12:40:54 +00:00
Configurable code formatting (Indentation + brace position)
This commit is contained in:
@@ -36,7 +36,8 @@ public class FileTextWriter extends GraphTextWriter implements AutoCloseable {
|
||||
private int indent;
|
||||
private int writtenBytes;
|
||||
|
||||
public FileTextWriter(FileOutputStream fos) {
|
||||
public FileTextWriter(CodeFormatting formatting,FileOutputStream fos) {
|
||||
super(formatting);
|
||||
this.writer = new BufferedWriter(new Utf8OutputStreamWriter(fos));
|
||||
}
|
||||
|
||||
@@ -90,7 +91,7 @@ public class FileTextWriter extends GraphTextWriter implements AutoCloseable {
|
||||
|
||||
@Override
|
||||
public FileTextWriter newLine() {
|
||||
writeToFile(NEW_LINE);
|
||||
writeToFile(formatting.newLineChars);
|
||||
newLine = true;
|
||||
return this;
|
||||
}
|
||||
@@ -120,7 +121,7 @@ public class FileTextWriter extends GraphTextWriter implements AutoCloseable {
|
||||
|
||||
private void appendIndent() {
|
||||
for (int i = 0; i < indent; i++) {
|
||||
writeToFile(INDENT_STRING);
|
||||
writeToFile(formatting.indentString);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user