Skip to content

Commit b0434aa

Browse files
committed
Fixed comments sometimes not being added
1 parent 331b380 commit b0434aa

File tree

1 file changed

+6
-1
lines changed
  • src/main/java/io/github/thatsmusic99/configurationmaster

1 file changed

+6
-1
lines changed

src/main/java/io/github/thatsmusic99/configurationmaster/CMFile.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,12 @@ public void addComment(@NotNull String path, @NotNull String comment) {
716716
builder.append(str).append("\n\n");
717717
}
718718
pendingComments.clear();
719-
comments.put(path.split("\\.")[0], builder.toString());
719+
String parent = path.split("\\.")[0];
720+
if (comments.containsKey(parent)) {
721+
comments.put(parent, comments.get(parent) + builder.toString());
722+
} else {
723+
comments.put(parent, builder.toString());
724+
}
720725
builder = new StringBuilder();
721726
builder.append(comment);
722727
if (comments.containsKey(path)) {

0 commit comments

Comments
 (0)