Skip to content

Commit

Permalink
fix(Studio): Exclude starting label when inserting Read-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Dec 27, 2024
1 parent f504d27 commit f0995f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Studio/CelesteStudio/Editing/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -923,15 +923,15 @@ private void AdjustFrameCounts(int rowA, int rowB, int dir) {

int? startLabelRow = null;
if (commandLine.Arguments.Length > 1) {
(var label, startLabelRow) = readLines
(string label, startLabelRow) = readLines
.FirstOrDefault(pair => pair.line == $"#{commandLine.Arguments[1]}");
if (label == null) {
continue;
}
}
int? endLabelRow = null;
if (commandLine.Arguments.Length > 2) {
(var label, endLabelRow) = readLines
(string label, endLabelRow) = readLines
.FirstOrDefault(pair => pair.line == $"#{commandLine.Arguments[2]}");
if (label == null) {
continue;
Expand All @@ -942,7 +942,7 @@ private void AdjustFrameCounts(int rowA, int rowB, int dir) {
endLabelRow ??= readLines.Length - 1;

fileStack.Push((path, row + 1, endRow, targetCommand)); // Store current state
fileStack.Push((fullPath, startLabelRow.Value, endLabelRow.Value - 1, commandLine)); // Setup next state
fileStack.Push((fullPath, startLabelRow.Value + 1, endLabelRow.Value - 1, commandLine)); // Setup next state (skip start / end labels)
break;
}
}
Expand Down

0 comments on commit f0995f7

Please sign in to comment.