Skip to content

Commit

Permalink
fix(Studio): Unable to uncomment breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Dec 14, 2024
1 parent 3be25c7 commit 3158244
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Studio/CelesteStudio/Editing/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2896,7 +2896,7 @@ private void OnToggleCommentBreakpoints() {
// Otherwise just comment uncommented breakpoints
bool allCommented = true;
for (int row = minRow; row <= maxRow; row++) {
var line = Document.Lines[row];
string line = Document.Lines[row];

if (UncommentedBreakpointRegex.IsMatch(line)) {
allCommented = false;
Expand All @@ -2905,7 +2905,7 @@ private void OnToggleCommentBreakpoints() {
}

for (int row = minRow; row <= maxRow; row++) {
var line = Document.Lines[row];
string line = Document.Lines[row];
if (allCommented && CommentedBreakpointRegex.IsMatch(line)) {
int hashIdx = line.IndexOf('#');
Document.ReplaceLine(row, line.Remove(hashIdx, 1));
Expand Down Expand Up @@ -2948,16 +2948,16 @@ private void OnToggleCommentInputs() {
}

for (int row = minRow; row <= maxRow; row++) {
var line = Document.Lines[row];
var lineTrimmed = line.TrimStart();
string line = Document.Lines[row];
string lineTrimmed = line.TrimStart();

// Ignore blank lines
if (string.IsNullOrEmpty(lineTrimmed) || lineTrimmed == "# ") {
continue;
}

if (lineTrimmed.StartsWith('#')) {
if ((!Comment.IsLabel(lineTrimmed) && !ActionLine.TryParse(lineTrimmed[1..], out _)) || lineTrimmed.StartsWith("#lvl_") || TimestampRegex.IsMatch(lineTrimmed)) {
if ((!Comment.IsLabel(lineTrimmed) && !lineTrimmed.StartsWith("#***") && !ActionLine.TryParse(lineTrimmed[1..], out _)) || lineTrimmed.StartsWith("#lvl_") || TimestampRegex.IsMatch(lineTrimmed)) {
// Ignore non-input comments and special labels
continue;
}
Expand Down Expand Up @@ -3005,7 +3005,7 @@ private void OnToggleCommentText() {
// Only remove # when all lines start with it. Otherwise, add another
bool allCommented = true;
for (int row = minRow; row <= maxRow; row++) {
var line = Document.Lines[row];
string line = Document.Lines[row];

if (!line.TrimStart().StartsWith('#')) {
allCommented = false;
Expand All @@ -3014,7 +3014,7 @@ private void OnToggleCommentText() {
}

for (int row = minRow; row <= maxRow; row++) {
var line = Document.Lines[row];
string line = Document.Lines[row];

if (allCommented) {
int hashIdx = line.IndexOf('#');
Expand Down

0 comments on commit 3158244

Please sign in to comment.