diff --git a/Studio/CelesteStudio/Dialog/FindDialog.cs b/Studio/CelesteStudio/Dialog/FindDialog.cs index b25045cad..2a5d34f29 100644 --- a/Studio/CelesteStudio/Dialog/FindDialog.cs +++ b/Studio/CelesteStudio/Dialog/FindDialog.cs @@ -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(); } @@ -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; } }