Skip to content

Commit

Permalink
fix(Studio): Wrong column for find-matches
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Sep 4, 2024
1 parent d02ba32 commit 17be03b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Studio/CelesteStudio/Dialog/FindDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ private void SelectPrev() {

private void SelectMatch(CaretPosition match) {
editor.Document.Caret = match;
editor.Document.Selection.Start = editor.Document.Caret;
editor.Document.Selection.End = editor.Document.Caret with { Col = editor.Document.Caret.Col + textBox.Text.Length };
editor.Document.Selection.Start = match;
editor.Document.Selection.End = match with { Col = match.Col + textBox.Text.Length };
editor.ScrollCaretIntoView(center: true);
editor.Invalidate();
}
Expand All @@ -138,7 +138,7 @@ private void UpdateMatches() {
break;
}

matches.Add(new CaretPosition(row, col));
matches.Add(new CaretPosition(row, col + idx));
col = idx + textBox.Text.Length;
}
}
Expand Down

0 comments on commit 17be03b

Please sign in to comment.