diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index c5fefb95d..85660e37f 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -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); diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index d6c4446c0..5e2c9dc63 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -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; diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h index 674ff5700..538c14fd2 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h @@ -28,6 +28,7 @@ #define FIND_INHIDDENDIR 2 #define FINDREPLACE_MAXLENGTH 2048 +#define FINDREPLACE_INSEL_TEXTSIZE_THRESHOLD 1024 #define FINDTEMPSTRING_MAXSIZE 1024*1024