Skip to content

Commit 5b14061

Browse files
docs: document 2-space indent assumption as yamlpatch-wide limitation
1 parent b90d303 commit 5b14061

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/document.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ fn apply_complex_replace(
287287
.map(|nl| nl + 1)
288288
.unwrap_or(0);
289289
let base_indent = feat_start - line_start;
290+
// NOTE: The +2 assumes 2-space indentation. This is consistent with yamlpatch,
291+
// which also hardcodes 2-space indent in Add, Append, MergeInto, and Replace ops.
292+
// Fixing this for non-2-space documents should be done upstream in yamlpatch.
290293
let value_indent = " ".repeat(base_indent + 2);
291294

292295
// Serialize the new value in block style

0 commit comments

Comments
 (0)