From 51ac33a4382d8f5fa1bbcd94c1c4af3d982f9836 Mon Sep 17 00:00:00 2001 From: psyGamer Date: Sun, 27 Oct 2024 11:24:59 +0100 Subject: [PATCH] tweak(Studio): Restrict multi-line comments to only "# " --- Studio/CelesteStudio/Editing/Editor.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Studio/CelesteStudio/Editing/Editor.cs b/Studio/CelesteStudio/Editing/Editor.cs index 4deb2a93..e9b7f7ea 100644 --- a/Studio/CelesteStudio/Editing/Editor.cs +++ b/Studio/CelesteStudio/Editing/Editor.cs @@ -2625,10 +2625,8 @@ private void OnEnter(bool splitLines, bool up) { line = Document.Lines[Document.Caret.Row]; } - string prefix = ""; - if (line.StartsWith('#')) { - prefix = new(line.TakeWhile(c => c == '#' || char.IsWhiteSpace(c)).ToArray()); - } + // Auto-insert # for multiline comments (not labels, not folds!) + string prefix = line.StartsWith("# ") ? "# " : ""; Document.Caret.Col = Math.Max(Document.Caret.Col, prefix.Length); string beforeCaret = line[prefix.Length..Document.Caret.Col];