mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 00:54:51 +08:00
Fixed sort dropping head comment #1181
This commit is contained in:
@@ -105,6 +105,7 @@ func getCommentsOperator(d *dataTreeNavigator, context Context, expressionNode *
|
||||
|
||||
node := &yaml.Node{Kind: yaml.ScalarNode, Value: comment, Tag: "!!str"}
|
||||
result := candidate.CreateReplacement(node)
|
||||
result.LeadingContent = "" // don't include the leading yaml content when retrieving a comment
|
||||
results.PushBack(result)
|
||||
}
|
||||
return context.ChildContext(results), nil
|
||||
|
||||
Reference in New Issue
Block a user