Fixed footer comment issue #1321

This commit is contained in:
Mike Farah
2022-08-30 11:24:26 +10:00
parent 3d11b0545d
commit bf6b4d3941
2 changed files with 31 additions and 0 deletions
+4
View File
@@ -63,8 +63,12 @@ func assignCommentsOperator(d *dataTreeNavigator, context Context, expressionNod
}
if preferences.FootComment && candidate.Node.Kind == yaml.DocumentNode && comment != "" {
candidate.TrailingContent = "# " + comment
} else if preferences.FootComment && candidate.Node.Kind == yaml.DocumentNode {
candidate.TrailingContent = comment
} else if preferences.FootComment && candidate.Node.Kind != yaml.DocumentNode {
candidate.Node.FootComment = comment
candidate.TrailingContent = ""
}
}