Skip to content

Commit

Permalink
Fixed: YamlStorage line splitting logic
Browse files Browse the repository at this point in the history
Signed-off-by: DevDrizzy <[email protected]>
  • Loading branch information
DevDrizzy committed Jul 27, 2024
1 parent 89491e7 commit 8dda472
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/xyz/refinedev/api/storage/YamlStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.simpleyaml.configuration.file.YamlFile;
import org.simpleyaml.configuration.implementation.api.QuoteStyle;

import org.simpleyaml.configuration.implementation.snakeyaml.SnakeYamlImplementation;
import xyz.refinedev.api.storage.annotations.ConfigValue;
import xyz.refinedev.api.storage.data.PluginData;

Expand Down Expand Up @@ -270,11 +271,13 @@ public void clearConfig() {
public void setupConfigOptions(YamlConfigurationOptions options) {
this.config.setCommentFormat(YamlCommentFormat.PRETTY);

options.charset(Charsets.UTF_8);
options.charset(com.google.common.base.Charsets.UTF_8);
options.useComments(true);
options.quoteStyleDefaults().setQuoteStyle(String.class, QuoteStyle.DOUBLE);
options.quoteStyleDefaults().setQuoteStyle(List.class, QuoteStyle.DOUBLE);
options.header(String.join("\n", this.getHeader()));

SnakeYamlImplementation implementation = (SnakeYamlImplementation) options.configuration().getImplementation();
implementation.getDumperOptions().setSplitLines(false);
}

/**
Expand Down

0 comments on commit 8dda472

Please sign in to comment.