Dyml icon indicating copy to clipboard operation
Dyml copied to clipboard

Comments behave weird if they get removed

Open Osiris-Team opened this issue 3 years ago • 2 comments

Example:

First run:

yaml.put("hello").setComment("my comment");
yaml.save();

First run output:

# my comment
hello:

Then in the second run, I change the code to this:

yaml.put("hello");
yaml.save();

Second run output is something like this:

#                                               my comment
hello:

Osiris-Team avatar Jul 10 '21 13:07 Osiris-Team

Maybe using commentLine.trim() fix that. https://github.com/Osiris-Team/Dream-Yaml/blob/b871df2579deeccd1deeb61c2185f29075e8aaa8/src/main/java/com/osiris/dyml/DYWriter.java#L140 I think the StringReader causes the error

Rubenicos avatar Jul 28 '21 15:07 Rubenicos

@Rubenicos if u got time to check that I would be really happy ^^ Am on vacation now for 3 weeks 😏

Osiris-Team avatar Jul 28 '21 23:07 Osiris-Team