Skip to content

Commit 7ad09ac

Browse files
committed
Add code to show default values of options (currently unused)
Related: #186
1 parent 84e27a7 commit 7ad09ac

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,19 @@ public void save() throws IOException {
381381
.sorted()
382382
.collect(Collectors.toList());
383383
for(String line : keys) {
384-
if(!line.equals("mixin.core"))
384+
if(!line.equals("mixin.core")) {
385+
Option option = this.options.get(line);
386+
String extraContext = "";
387+
if(option != null) {
388+
if(option.isModDefined())
389+
extraContext = " # (overridden for mod compat)";
390+
else {
391+
boolean defaultEnabled = DEFAULT_SETTING_OVERRIDES.getOrDefault(line, true);
392+
extraContext = " # (default: " + defaultEnabled + ")";
393+
}
394+
}
385395
writer.write("# " + line + "\n");
396+
}
386397
}
387398

388399
for (String key : keys) {

0 commit comments

Comments
 (0)