mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ fix: F/R dialog don't change selection by typing search pattern
This commit is contained in:
parent
21e2722fc1
commit
387f28e8b2
11
src/Edit.c
11
src/Edit.c
@ -6025,9 +6025,10 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
bool const bEnableReplInSel = !(SciCall_IsSelectionEmpty() || Sci_IsMultiOrRectangleSelection());
|
||||
DialogEnableControl(hwnd, IDC_REPLACEINSEL, bEnableReplInSel);
|
||||
|
||||
// redraw all
|
||||
SendWMCommandEx(hwnd, IDC_FINDTEXT, CBN_EDITCHANGE);
|
||||
_DelayMarkAll(hwnd, 50, 0);
|
||||
|
||||
// don't do:
|
||||
///~SendWMCommandEx(hwnd, IDC_FINDTEXT, CBN_EDITCHANGE);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -6085,7 +6086,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
switch (HIWORD(wParam)) {
|
||||
case CBN_CLOSEUP:
|
||||
case CBN_EDITCHANGE:
|
||||
bPatternChanged = true;
|
||||
bPatternChanged = (LOWORD(wParam) == IDC_FINDTEXT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -6132,9 +6133,9 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
DocPos const slen = StringCchLenA(s_pEfrDataDlg->szFind, COUNTOF(s_pEfrDataDlg->szFind));
|
||||
DocPos const iPos = _FindInTarget(s_pEfrDataDlg->szFind, slen, (int)(s_pEfrDataDlg->fuFlags), &start, &end, false, FRMOD_NORM);
|
||||
if (iPos >= 0) {
|
||||
EditSetSelectionEx(iPos, end, -1, -1);
|
||||
SciCall_ScrollRange(end, iPos);
|
||||
} else {
|
||||
EditSetSelectionEx(s_InitialAnchorPos, s_InitialCaretPos, -1, -1);
|
||||
SciCall_ScrollRange(s_InitialAnchorPos, s_InitialCaretPos);
|
||||
if (s_InitialTopLine >= 0) {
|
||||
SciCall_SetFirstVisibleLine(s_InitialTopLine);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user