From 5c10f58212ed1f2efbfa2e8daa812961b6b26e1f Mon Sep 17 00:00:00 2001 From: Alan Kilborn Date: Wed, 15 Feb 2023 15:19:42 -0500 Subject: [PATCH] Fix hit text in search results being out of sight issue Fix #13129, close #13138 --- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 1d8877e69..d58a7e7b2 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -535,6 +535,7 @@ bool Finder::notify(SCNotification *notification) end = lineEndAbsPos; _scintView.execute(SCI_SETSEL, begin, end); + _scintView.execute(SCI_SCROLLRANGE, begin, end); } break; @@ -939,7 +940,6 @@ void Finder::gotoNextFoundResult(int direction) } _scintView.execute(SCI_ENSUREVISIBLE, lno); - _scintView.execute(SCI_SCROLLCARET); std::pair newPos = gotoFoundLine(n); lineStartAbsPos = _scintView.execute(SCI_POSITIONFROMLINE, lno); @@ -952,6 +952,7 @@ void Finder::gotoNextFoundResult(int direction) end = lineEndAbsPos; _scintView.execute(SCI_SETSEL, begin, end); + _scintView.execute(SCI_SCROLLRANGE, begin, end); } @@ -4028,6 +4029,7 @@ LRESULT FAR PASCAL FindReplaceDlg::finderProc(HWND hwnd, UINT message, WPARAM wP end = lineEndAbsPos; pFinder->_scintView.execute(SCI_SETSEL, begin, end); + pFinder->_scintView.execute(SCI_SCROLLRANGE, begin, end); } else if (wParam == VK_ESCAPE) pFinder->display(false);