From 3db09c2d2b202847aa0efed00864a76037180aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Kj=C3=A6r=20Damgaard?= Date: Sun, 27 Oct 2024 03:27:07 +0100 Subject: [PATCH] Formatter: Remove leading newline (#65) --- server/src/parser/formatter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/parser/formatter.ts b/server/src/parser/formatter.ts index 607b67a..cd08ac5 100644 --- a/server/src/parser/formatter.ts +++ b/server/src/parser/formatter.ts @@ -115,8 +115,8 @@ export default class Formatter { formatted = formatted.split('\n').map(line => line.trimRight()).join('\n'); if (!isPlainLuaFile) { - // Add whitespace buffer at beginning and end - formatted = '\n' + formatted + '\n'; + // Add whitespace buffer at the end + formatted = formatted + '\n'; // add an extra newline if we found an ending tag (__gfx__ for example) if (formatRange.end.line !== Number.MAX_VALUE) {