Fix multiline + non-primitive commenting (#336)

Fixes #216
This commit is contained in:
Allen
2020-03-17 10:51:47 +08:00
committed by GitHub
parent ad60b7e437
commit a12e102214
5 changed files with 247 additions and 30 deletions
+4
View File
@@ -222,8 +222,12 @@ func (t *Tree) SetPathWithOptions(keys []string, opts SetOptions, value interfac
switch v := value.(type) {
case *Tree:
v.comment = opts.Comment
v.commented = opts.Commented
toInsert = value
case []*Tree:
for i := range v {
v[i].commented = opts.Commented
}
toInsert = value
case *tomlValue:
v.comment = opts.Comment