Dont clobber anchor when adding nodes - fixes #1269

This commit is contained in:
Mike Farah
2022-07-13 11:12:15 +10:00
parent f3a8c4b2ec
commit f393cf37c2
4 changed files with 21 additions and 9 deletions
+3 -1
View File
@@ -56,7 +56,9 @@ func add(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *Candida
return lhs.CreateReplacement(rhs.Node), nil
}
target := lhs.CreateReplacement(&yaml.Node{})
target := lhs.CreateReplacement(&yaml.Node{
Anchor: lhs.Node.Anchor,
})
switch lhsNode.Kind {
case yaml.MappingNode: