Skip to content

Commit 5aeeeb1

Browse files
fix: addSequence: clear rhs node Keys to ensure index is assigned
1 parent c58d9e7 commit 5aeeeb1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/yqlib/operator_add.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ func toNodes(candidate *CandidateNode, lhs *CandidateNode) []*CandidateNode {
2626

2727
switch candidate.Kind {
2828
case SequenceNode:
29+
content := clone.Content
30+
for _, node := range content {
31+
node.Key = nil
32+
}
2933
return clone.Content
3034
default:
3135
if len(lhs.Content) > 0 {
3236
clone.Style = lhs.Content[0].Style
3337
}
38+
clone.Key = nil
3439
return []*CandidateNode{clone}
3540
}
3641

0 commit comments

Comments
 (0)