Skip to content

Commit

Permalink
Skip comments for top-level edits
Browse files Browse the repository at this point in the history
  • Loading branch information
kekavc24 committed Jul 2, 2024
1 parent 5a51cbe commit c7aec85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ class YamlEditor {

if (path.isEmpty) {
final start = _contents.span.start.offset;
final end = getContentSensitiveEnd(_contents);
var end = getContentSensitiveEnd(_contents);
final lineEnding = getLineEnding(_yaml);
end = skipAndExtractCommentsInBlock(_yaml, end, null, lineEnding).$1;
var encoded = yamlEncodeBlock(valueNode, 0, lineEnding);
encoded =
normalizeEncodedBlock(_yaml, lineEnding, end, valueNode, encoded);
Expand Down

0 comments on commit c7aec85

Please sign in to comment.