diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index bc3e2a38..b676cfef 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -219,10 +219,12 @@ void Searching::displaySectionCentered(int posStart, int posEnd, ScintillaEditVi pEditView->execute(SCI_ENSUREVISIBLE, pEditView->execute(SCI_LINEFROMPOSITION, posEnd)); // Jump-scroll to center, if current position is out of view - pEditView->execute(SCI_SETYCARETPOLICY, CARET_JUMPS | CARET_EVEN); + pEditView->execute(SCI_SETVISIBLEPOLICY, CARET_JUMPS | CARET_EVEN); + pEditView->execute(SCI_ENSUREVISIBLEENFORCEPOLICY, pEditView->execute(SCI_LINEFROMPOSITION, isDownwards ? posEnd : posStart)); // When searching up, the beginning of the (possible multiline) result is important, when scrolling down the end pEditView->execute(SCI_GOTOPOS, isDownwards ? posEnd : posStart); - pEditView->execute(SCI_SETYCARETPOLICY, CARET_EVEN); + pEditView->execute(SCI_SETVISIBLEPOLICY, CARET_EVEN); + pEditView->execute(SCI_ENSUREVISIBLEENFORCEPOLICY, pEditView->execute(SCI_LINEFROMPOSITION, isDownwards ? posEnd : posStart)); // Adjust so that we see the entire match; primarily horizontally pEditView->execute(SCI_SCROLLRANGE, posStart, posEnd);