hadashiA / VYaml

The extra fast, low memory footprint YAML library for C#, focued on .NET and Unity.
MIT License
305 stars 18 forks source link

配列を書き込んだあとのMapキーの書き出しインデントが一つ手前にずれる #20

Closed Freeesia closed 1 year ago

Freeesia commented 1 year ago

以下のようなクラスHogeをymlに出力するとProps2のインデントがずれます。

[YamlObject]
partial class Hoge
{
    public Fuga Fuga { get; set; }
}
[YamlObject]
partial class Fuga
{
    public string[] Props1 { get; set; }
    public string[] Props2 { get; set; }
}
fuga: 
  props1: 
  - a
  - b
props2: 
- c
- d

以下の箇所でインデントの増減が一致していないことが原因かと思われます。 https://github.com/hadashiA/VYaml/blob/master/VYaml.Core/Emitter/Utf8YamlEmitter.cs#L114 https://github.com/hadashiA/VYaml/blob/master/VYaml.Core/Emitter/Utf8YamlEmitter.cs#L185

hadashiA commented 1 year ago

@Freeesia #25 で修正しました。厄介な不具合だと思うので教えていただいて助かります

Freeesia commented 1 year ago

@hadashiA こちらも対応ありがとうございました。 かなり無理矢理回避してたので助かります。