From 17be03bf60501f92eb04cea41cf9167b17792616 Mon Sep 17 00:00:00 2001 From: psyGamer Date: Wed, 4 Sep 2024 10:49:30 +0200 Subject: [PATCH] fix(Studio): Wrong column for find-matches --- Studio/CelesteStudio/Dialog/FindDialog.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } }