From 4b0010c4c32924d8ec0d2daa8acd11a048393bc1 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 3 Mar 2021 20:01:16 +0100 Subject: [PATCH] Fix regression in "Find Result" field due to Scintilla upgrade Fix #9595 --- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 43dfcca71..4e929fe24 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -3937,8 +3937,13 @@ void Finder::beginNewFilesSearch() NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); _prefixLineStr = pNativeSpeaker->getLocalizedStrFromID("find-result-line-prefix", TEXT("Line")); + // Use SCI_SETSEL(0, 0) instead of SCI_SETCURRENTPOS(0) to workaround + // an eventual regression or a change of behaviour in Scintilla 4.4.6 + // ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/9595#issuecomment-789824579 + // + _scintView.execute(SCI_SETSEL, 0, 0); + //_scintView.execute(SCI_SETCURRENTPOS, 0); - _scintView.execute(SCI_SETCURRENTPOS, 0); _pMainFoundInfos = _pMainFoundInfos == &_foundInfos1 ? &_foundInfos2 : &_foundInfos1; _pMainMarkings = _pMainMarkings == &_markings1 ? &_markings2 : &_markings1; _nbFoundFiles = 0;