SPIGOT-6866: Fixed spaces a between comment indicator and actual comment

By: Wolf2323 <gabrielpatrikurban@gmail.com>
This commit is contained in:
Bukkit/Spigot
2021-12-23 23:07:00 +01:00
parent 46d8d2cd11
commit 0503e4faed
3 changed files with 15 additions and 11 deletions

View File

@@ -204,7 +204,9 @@ public class YamlConfiguration extends FileConfiguration {
if (comment.getCommentType() == CommentType.BLANK_LINE) {
lines.add(null);
} else {
lines.add(comment.getValue());
String line = comment.getValue();
line = line.startsWith(" ") ? line.substring(1) : line;
lines.add(line);
}
}
}
@@ -217,7 +219,9 @@ public class YamlConfiguration extends FileConfiguration {
if (comment == null) {
lines.add(new CommentLine(null, null, "", CommentType.BLANK_LINE));
} else {
lines.add(new CommentLine(null, null, comment, commentType));
String line = comment;
line = line.isEmpty() ? line : " " + line;
lines.add(new CommentLine(null, null, line, commentType));
}
}
return lines;