From 310c6c8600db1a5c68f29c70fcd3815ffde9cdda Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 6 May 2026 10:28:26 -0400 Subject: [PATCH] Regression test for #1245 Signed-off-by: David Thompson --- test/formatter.test.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/formatter.test.ts b/test/formatter.test.ts index adc0c674..3c244bbf 100644 --- a/test/formatter.test.ts +++ b/test/formatter.test.ts @@ -303,6 +303,30 @@ list: assert.equal(edits[0].newText, expected); }); + + it('Comments separated by blank lines do not inherit indentation of previous lines', async () => { + const content = `# Section 1 + +variables: + - "C" + - 1 + - false + # four: true + +# Section 2 + +more_variables: + - "A" + - 2 +`; + + const edits = await parseSetup(content, { + tabSize: 1, + tabWidth: 2, + }); + + assert.equal(edits.length, 0, `Edits: ${JSON.stringify(edits)}`); + }); }); }); });