Don't populate in Find what if a stream selection more than 1024 characters
Avoid auto-population into "Find What" if "In Selection" is going to be auto-checkmarked. Fix #12603, close #12603
This commit is contained in:
parent
9c0e1e4559
commit
fa9504d595
|
@ -1249,7 +1249,10 @@ void Notepad_plus::command(int id)
|
|||
if (nppGui._fillFindFieldWithSelected)
|
||||
{
|
||||
_pEditView->getGenericSelectedText(str, strSize, nppGui._fillFindFieldSelectCaret);
|
||||
_findReplaceDlg.setSearchText(str);
|
||||
if (lstrlen(str) <= FINDREPLACE_INSEL_TEXTSIZE_THRESHOLD)
|
||||
{
|
||||
_findReplaceDlg.setSearchText(str);
|
||||
}
|
||||
}
|
||||
|
||||
setFindReplaceFolderFilter(NULL, NULL);
|
||||
|
|
|
@ -1442,7 +1442,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||
|
||||
if (!_options._isInSelection)
|
||||
{
|
||||
if (nbSelected <= 1024)
|
||||
if (nbSelected <= FINDREPLACE_INSEL_TEXTSIZE_THRESHOLD)
|
||||
{
|
||||
checkVal = BST_UNCHECKED;
|
||||
_options._isInSelection = false;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#define FIND_INHIDDENDIR 2
|
||||
|
||||
#define FINDREPLACE_MAXLENGTH 2048
|
||||
#define FINDREPLACE_INSEL_TEXTSIZE_THRESHOLD 1024
|
||||
|
||||
#define FINDTEMPSTRING_MAXSIZE 1024*1024
|
||||
|
||||
|
|
Loading…
Reference in New Issue