Enhance UX in "Find in file" action while Directory field is empty

Move the input focus to Directory edit control if Directory field is empty while launching Find in files search.

Fix #16051, close #16057
This commit is contained in:
Alan Kilborn 2025-01-12 20:58:06 -05:00 committed by Don Ho
parent e28324b8d0
commit d7ddb6ea3a

View File

@ -2244,6 +2244,11 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
findAllIn(FILES_IN_DIR); findAllIn(FILES_IN_DIR);
nppParamInst._isFindReplacing = false; nppParamInst._isFindReplacing = false;
} }
else
{
// move input focus to "Directory:" edit control
::SendMessage(_hSelf, WM_NEXTDLGCTL, reinterpret_cast<WPARAM>(::GetDlgItem(_hSelf, IDD_FINDINFILES_DIR_COMBO)), TRUE);
}
} }
else if (_currentStatus == FINDINPROJECTS_DLG) else if (_currentStatus == FINDINPROJECTS_DLG)
{ {
@ -2296,6 +2301,11 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
nppParamInst._isFindReplacing = false; nppParamInst._isFindReplacing = false;
} }
} }
else
{
// move input focus to "Directory:" edit control
::SendMessage(_hSelf, WM_NEXTDLGCTL, reinterpret_cast<WPARAM>(::GetDlgItem(_hSelf, IDD_FINDINFILES_DIR_COMBO)), TRUE);
}
} }
return TRUE; return TRUE;