core: fix js-yaml options

This commit is contained in:
undefined committed 2026-07-25 11:25:38 +00:00
1 parent 2f99407669
commit 591dbd31c0
9 files changed
+25 -29

No files matched your search

@@ -98,7 +98,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
async componentDidMount() {
const { monaco } = await load(['yaml']);
const uri = monaco.Uri.parse('hydro://problem/file/config.yaml');
this.model = monaco.editor.createModel(yaml.dump(configYamlFormat(this.props.config), { noArrayIndent: true }), 'yaml', uri);
this.model = monaco.editor.createModel(yaml.dump(configYamlFormat(this.props.config), { seqNoIndent: true }), 'yaml', uri);
this.vjEditor = Editor.getOrConstruct($(this.containerElement), {
language: 'yaml',
model: this.model,
@@ -114,7 +114,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
componentDidUpdate(prevProps) {
if (this.__preventUpdate || !this.model || !this.props.config.__valid) return;
if (yaml.dump(prevProps.config, { noArrayIndent: true }) === yaml.dump(this.props.config, { noArrayIndent: true })) return;
if (yaml.dump(prevProps.config, { seqNoIndent: true }) === yaml.dump(this.props.config, { seqNoIndent: true })) return;
const curValue = this.model.getValue();
const pending = configYamlFormat(this.props.config);
try {
@@ -122,7 +122,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
if (isEqual(curConfig, pending)) return;
} catch { }
this.__preventFormat = true;
const diff = diffLines(curValue, yaml.dump(pending, { noArrayIndent: true }));
const diff = diffLines(curValue, yaml.dump(pending, { seqNoIndent: true }));
const ops = [];
let cursor = 1;
for (const line of diff) {