Carleslc / Simple-YAML

This Java API provides an easy-to-use way to store data and provide configurations using the YAML format.
https://carleslc.me/Simple-YAML
GNU General Public License v3.0
130 stars 38 forks source link

Comments being inserted twice #6

Closed Mezy closed 4 years ago

Mezy commented 4 years ago

Original file: original After saving it with comments: with-comments The comments are inserted twice, this also means the commentsWritten value is increased twice meaning the last comment of the file won't be saved as "commentsWritten < n" is false. I solved this issue by removing the comment from the comments list after it's inserted once but this won't work for everyone.

Carleslc commented 4 years ago

This is happening up to v1.4 due to ambiguity for keys with the same name (cannot differentiate if the comment is referring to sub-section-1.list or sub-section-2.list). I've updated the way this API was handling comments so from v1.5 this issue is fixed.