hadashiA/VYaml

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

Closed this issue · 2 comments

以下のようなクラス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

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

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