Skip to content

Commit

Permalink
feat(Studio): Auto-split lines on first and last column
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Oct 25, 2024
1 parent b1dc2fa commit 023c37b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Studio/CelesteStudio/Editing/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2596,7 +2596,10 @@ private void OnDelete(CaretMovementType direction) {
private void OnEnter(bool splitLines, bool up) {
using var __ = Document.Update();

var line = Document.Lines[Document.Caret.Row];
string line = Document.Lines[Document.Caret.Row];

// Auto-split on first and last column since nothing is broken there
splitLines = splitLines || Document.Caret.Col == 0 || Document.Caret.Col == line.Length;

int offset = up ? 0 : 1;
if (!splitLines || ActionLine.TryParse(line, out _)) {
Expand Down

0 comments on commit 023c37b

Please sign in to comment.