mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
sort keys when saving Settings files (i.e. theme.txt)
This commit is contained in:
@@ -113,7 +113,10 @@ public class Settings {
|
||||
public void save(File outputFile) {
|
||||
PrintWriter writer = PApplet.createWriter(outputFile);
|
||||
|
||||
for (String key : table.keySet()) {
|
||||
String[] keyList = table.keySet().toArray(new String[0]);
|
||||
// Sorting is really helpful for debugging, diffing, and finding keys
|
||||
keyList = PApplet.sort(keyList);
|
||||
for (String key : keyList) {
|
||||
writer.println(key + "=" + table.get(key));
|
||||
}
|
||||
|
||||
@@ -162,6 +165,7 @@ public class Settings {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void setInteger(String key, int value) {
|
||||
set(key, String.valueOf(value));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user