Enhance "Follow current doc." GUI action/option in Find in files

Fix #15908, close #15938
This commit is contained in:
Alan Kilborn 2024-12-11 08:27:52 -05:00 committed by Don Ho
parent 06a03ea41e
commit 6453379ac8
13 changed files with 63 additions and 54 deletions

View File

@ -500,7 +500,6 @@ Translation note:
<Item id="1626" name="E&amp;xtended (\n, \r, \t, \0, \x...)"/>
<Item id="1660" name="Replace in Files"/>
<Item id="1665" name="Replace in Projects"/>
<Item id="1661" name="Follow current doc."/>
<Item id="1662" name="Project Panel 1"/>
<Item id="1663" name="Project Panel 2"/>
<Item id="1664" name="Project Panel 3"/>
@ -1191,6 +1190,7 @@ Translation note:
<Item id="6908" name="Fill Find Field with Selected Text"/>
<Item id="6909" name="Select Word Under Caret when Nothing Selected"/>
<Item id="6910" name="Minimum Size for Auto-Checking &quot;In selection&quot;:"/>
<Item id="6913" name="Fill Find in Files Directory Field Based On Active Document"/>
</Searching>
<RecentFilesHistory title="Recent Files History">
@ -1690,6 +1690,7 @@ Find in all files but exclude folders tests, bin &amp;&amp; bin64:
Find in all files but exclude all folders log or logs recursively:
*.* !+\log*"/><!-- HowToReproduce: Tip of mouse hovered on "Filters" label in "Find in Files" section of Find dialog. -->
<find-in-files-select-folder value="Select a folder to search from"/><!-- HowToReproduce: Search > Find in Files > [...] -->
<find-in-files-dir-from-active-doc-tip value="Fill Directory field based on active document"/><!-- HowToReproduce: Search > Find in Files > [<<] -->
<find-status-top-reached value="Find: Reached document beginning, first occurrence from the bottom found."/>
<find-status-end-reached value="Find: Reached document end, first occurrence from the top found."/>
<find-status-replaceinfiles-1-replaced value="Replace in Files: 1 occurrence was replaced"/>

View File

@ -500,7 +500,6 @@ Translation note:
<Item id="1626" name="E&amp;xtended (\n, \r, \t, \0, \x...)"/>
<Item id="1660" name="Replace in Files"/>
<Item id="1665" name="Replace in Projects"/>
<Item id="1661" name="Follow current doc."/>
<Item id="1662" name="Project Panel 1"/>
<Item id="1663" name="Project Panel 2"/>
<Item id="1664" name="Project Panel 3"/>
@ -1189,6 +1188,7 @@ Translation note:
<Item id="6908" name="Fill Find Field with Selected Text"/>
<Item id="6909" name="Select Word Under Caret when Nothing Selected"/>
<Item id="6910" name="Minimum Size for Auto-Checking &quot;In selection&quot;:"/>
<Item id="6913" name="Fill Find in Files Directory Field Based On Active Document"/>
</Searching>
<RecentFilesHistory title="Recent Files History">
@ -1688,6 +1688,7 @@ Find in all files but exclude folders tests, bin &amp;&amp; bin64:
Find in all files but exclude all folders log or logs recursively:
*.* !+\log*"/><!-- HowToReproduce: Tip of mouse hovered on "Filters" label in "Find in Files" section of Find dialog. -->
<find-in-files-select-folder value="Select a folder to search from"/><!-- HowToReproduce: Search > Find in Files > [...] -->
<find-in-files-dir-from-active-doc-tip value="Fill directory field based on active document"/><!-- HowToReproduce: Search > Find in Files > [<<] -->
<find-status-top-reached value="Find: Reached document beginning, first occurrence from the bottom found."/>
<find-status-end-reached value="Find: Reached document end, first occurrence from the top found."/>
<find-status-replaceinfiles-1-replaced value="Replace in Files: 1 occurrence was replaced"/>

View File

@ -6927,10 +6927,11 @@ void Notepad_plus::setFindReplaceFolderFilter(const wchar_t *dir, const wchar_t
{
wstring fltr;
NppParameters& nppParam = NppParameters::getInstance();
NppGUI& nppGui = nppParam.getNppGUI();
FindHistory & findHistory = nppParam.getFindHistory();
// get current directory in case it's not provided.
if (!dir && findHistory._isFolderFollowDoc)
if (!dir && nppGui._fillDirFieldFromActiveDoc)
{
dir = nppParam.getWorkingDir();
}

View File

@ -493,8 +493,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
bool isFirstTime = !_findReplaceDlg.isCreated();
_findReplaceDlg.doDialog(FIND_DLG, _nativeLangSpeaker.isRTL());
const NppGUI & nppGui = nppParam.getNppGUI();
const NppGUI& nppGui = nppParam.getNppGUI();
if (nppGui._fillFindFieldWithSelected)
{
wchar_t str[strSize]{};

View File

@ -2795,10 +2795,6 @@ void NppParameters::feedFindHistoryParameters(TiXmlNode *node)
if (boolStr)
_findHistory._isFilterFollowDoc = (lstrcmp(L"yes", boolStr) == 0);
boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifFolderFollowsDoc");
if (boolStr)
_findHistory._isFolderFollowDoc = (lstrcmp(L"yes", boolStr) == 0);
int mode = 0;
boolStr = (findHistoryRoot->ToElement())->Attribute(L"searchMode", &mode);
if (boolStr)
@ -6173,6 +6169,12 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
{
_nppGUI._inSelectionAutocheckThreshold = FINDREPLACE_INSELECTION_THRESHOLD_DEFAULT;
}
const wchar_t* optFillDirFieldFromActiveDoc = element->Attribute(L"fillDirFieldFromActiveDoc");
if (optFillDirFieldFromActiveDoc)
{
_nppGUI._fillDirFieldFromActiveDoc = (lstrcmp(optFillDirFieldFromActiveDoc, L"yes") == 0);
}
}
else if (!lstrcmp(nm, L"MISC"))
{
@ -7738,6 +7740,7 @@ void NppParameters::createXmlTreeFromGUIParams()
GUIConfigElement->SetAttribute(L"confirmReplaceInAllOpenDocs", _nppGUI._confirmReplaceInAllOpenDocs ? L"yes" : L"no");
GUIConfigElement->SetAttribute(L"replaceStopsWithoutFindingNext", _nppGUI._replaceStopsWithoutFindingNext ? L"yes" : L"no");
GUIConfigElement->SetAttribute(L"inSelectionAutocheckThreshold", _nppGUI._inSelectionAutocheckThreshold);
GUIConfigElement->SetAttribute(L"fillDirFieldFromActiveDoc", _nppGUI._fillDirFieldFromActiveDoc ? L"yes" : L"no");
}
// <GUIConfig name="searchEngine" searchEngineChoice="2" searchEngineCustom="" />
@ -7865,7 +7868,6 @@ bool NppParameters::writeFindHistory()
(findHistoryRoot->ToElement())->SetAttribute(L"fifProjectPanel2", _findHistory._isFifProjectPanel_2 ? L"yes" : L"no");
(findHistoryRoot->ToElement())->SetAttribute(L"fifProjectPanel3", _findHistory._isFifProjectPanel_3 ? L"yes" : L"no");
(findHistoryRoot->ToElement())->SetAttribute(L"fifFilterFollowsDoc", _findHistory._isFilterFollowDoc ? L"yes" : L"no");
(findHistoryRoot->ToElement())->SetAttribute(L"fifFolderFollowsDoc", _findHistory._isFolderFollowDoc ? L"yes" : L"no");
(findHistoryRoot->ToElement())->SetAttribute(L"searchMode", _findHistory._searchMode);
(findHistoryRoot->ToElement())->SetAttribute(L"transparencyMode", _findHistory._transparencyMode);

View File

@ -851,6 +851,7 @@ struct NppGUI final
bool _confirmReplaceInAllOpenDocs = true;
bool _replaceStopsWithoutFindingNext = false;
int _inSelectionAutocheckThreshold = FINDREPLACE_INSELECTION_THRESHOLD_DEFAULT;
bool _fillDirFieldFromActiveDoc = false;
bool _muteSounds = false;
bool _enableFoldCmdToggable = false;
bool _hideMenuRightShortcuts = false;
@ -1243,7 +1244,6 @@ struct FindHistory final
int _transparency = 150;
bool _isFilterFollowDoc = false;
bool _isFolderFollowDoc = false;
bool _isBookmarkLine = false;
bool _isPurge = false;

View File

@ -266,6 +266,9 @@ FindReplaceDlg::~FindReplaceDlg()
if (_2ButtonsTip)
::DestroyWindow(_2ButtonsTip);
if (_dirFromActiveDocTip)
::DestroyWindow(_dirFromActiveDocTip);
if (_filterTip)
::DestroyWindow(_filterTip);
@ -383,7 +386,6 @@ void FindReplaceDlg::fillFindHistory()
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_INHIDDENDIR_CHECK, BM_SETCHECK, findHistory._isFifInHiddenFolder, 0);
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_RECURSIVE_CHECK, BM_SETCHECK, findHistory._isFifRecuisive, 0);
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK, BM_SETCHECK, findHistory._isFolderFollowDoc, 0);
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_PROJECT1_CHECK, BM_SETCHECK, findHistory._isFifProjectPanel_1, 0);
::SendDlgItemMessage(_hSelf, IDD_FINDINFILES_PROJECT2_CHECK, BM_SETCHECK, findHistory._isFifProjectPanel_2, 0);
@ -1216,14 +1218,14 @@ void FindReplaceDlg::resizeDialogElements()
//elements that need to be moved
const auto moveCheckIds = {
IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK,IDD_FINDINFILES_RECURSIVE_CHECK, IDD_FINDINFILES_INHIDDENDIR_CHECK,
IDD_FINDINFILES_RECURSIVE_CHECK, IDD_FINDINFILES_INHIDDENDIR_CHECK,
IDD_FINDINFILES_PROJECT1_CHECK, IDD_FINDINFILES_PROJECT2_CHECK, IDD_FINDINFILES_PROJECT3_CHECK,
};
const auto moveBtnIDs = {
IDCMARKALL, IDC_CLEAR_ALL, IDCCOUNTALL, IDC_FINDALL_OPENEDFILES, IDC_FINDALL_CURRENTFILE,
IDREPLACE, IDREPLACEALL, IDC_REPLACE_OPENEDFILES, IDD_FINDINFILES_FIND_BUTTON, IDD_FINDINFILES_REPLACEINFILES, IDCANCEL,
IDC_FINDPREV, IDC_COPY_MARKED_TEXT, IDD_FINDINFILES_REPLACEINPROJECTS
IDC_FINDPREV, IDC_COPY_MARKED_TEXT, IDD_FINDINFILES_REPLACEINPROJECTS, IDD_FINDINFILES_SETDIRFROMDOC_BUTTON,
};
const auto moveOtherCtrlsIDs = {
@ -1502,7 +1504,8 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
NppDarkMode::setDarkTooltips(_shiftTrickUpTip, NppDarkMode::ToolTipsType::tooltip);
NppDarkMode::setDarkTooltips(_2ButtonsTip, NppDarkMode::ToolTipsType::tooltip);
NppDarkMode::setDarkTooltips(_filterTip, NppDarkMode::ToolTipsType::tooltip);
NppDarkMode::setDarkTooltips(_dirFromActiveDocTip, NppDarkMode::ToolTipsType::tooltip);
if (_statusbarTooltipWnd)
{
NppDarkMode::setDarkTooltips(_statusbarTooltipWnd, NppDarkMode::ToolTipsType::tooltip);
@ -1587,6 +1590,9 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
wstring findInFilesFilterTip = pNativeSpeaker->getLocalizedStrFromID("find-in-files-filter-tip", L"Find in cpp, cxx, h, hxx && hpp:\r*.cpp *.cxx *.h *.hxx *.hpp\r\rFind in all files except exe, obj && log:\r*.* !*.exe !*.obj !*.log\r\rFind in all files but exclude folders tests, bin && bin64:\r*.* !\\tests !\\bin*\r\rFind in all files but exclude all folders log or logs recursively:\r*.* !+\\log*");
_filterTip = CreateToolTip(IDD_FINDINFILES_FILTERS_STATIC, _hSelf, _hInst, const_cast<PTSTR>(findInFilesFilterTip.c_str()), _isRTL);
wstring dirFromActiveDocTip = pNativeSpeaker->getLocalizedStrFromID("find-in-files-dir-from-active-doc-tip", L"Fill directory field based on active document");
_dirFromActiveDocTip = CreateToolTip(IDD_FINDINFILES_SETDIRFROMDOC_BUTTON, _hSelf, _hInst, const_cast<PTSTR>(dirFromActiveDocTip.c_str()), _isRTL);
::SetWindowTextW(::GetDlgItem(_hSelf, IDC_FINDPREV), L"");
::SetWindowTextW(::GetDlgItem(_hSelf, IDC_FINDNEXT), L"▼ Find Next");
@ -2661,28 +2667,19 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
}
return TRUE;
case IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK :
case IDD_FINDINFILES_SETDIRFROMDOC_BUTTON :
{
if (_currentStatus == FINDINFILES_DLG)
findHistory._isFolderFollowDoc = isCheckedOrNot(IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK);
if (findHistory._isFolderFollowDoc)
wstring currPath;
const Buffer* buf = (*_ppEditView)->getCurrentBuffer();
if (!(buf->getStatus() & (DOC_UNNAMED | DOC_DELETED)))
{
// Working directory depends on "Default Directory" preferences.
// It might be set to an absolute path value.
// So try to get the current buffer's path first.
wstring currPath;
const Buffer* buf = (*_ppEditView)->getCurrentBuffer();
if (!(buf->getStatus() & (DOC_UNNAMED | DOC_DELETED)))
{
currPath = buf->getFullPathName();
pathRemoveFileSpec(currPath);
}
if (currPath.empty() || !doesDirectoryExist(currPath.c_str()))
currPath = NppParameters::getInstance().getWorkingDir();
::SetDlgItemText(_hSelf, IDD_FINDINFILES_DIR_COMBO, currPath.c_str());
currPath = buf->getFullPathName();
pathRemoveFileSpec(currPath);
}
if (!currPath.empty() && doesDirectoryExist(currPath.c_str()))
{
setFindInFilesDirFilter(currPath.c_str(), NULL);
}
}
return TRUE;
@ -4025,7 +4022,7 @@ void FindReplaceDlg::enableFindInFilesControls(bool isEnable, bool projectPanels
showFindDlgItem(IDD_FINDINFILES_PROJECT1_CHECK, isEnable && projectPanels);
showFindDlgItem(IDD_FINDINFILES_PROJECT2_CHECK, isEnable && projectPanels);
showFindDlgItem(IDD_FINDINFILES_PROJECT3_CHECK, isEnable && projectPanels);
showFindDlgItem(IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK, isEnable && (!projectPanels));
showFindDlgItem(IDD_FINDINFILES_SETDIRFROMDOC_BUTTON, isEnable && (!projectPanels));
}
void FindReplaceDlg::getPatterns(vector<wstring> & patternVect)

View File

@ -412,7 +412,6 @@ public :
bool removeFinder(Finder *finder2remove);
DIALOG_TYPE getCurrentStatus() {return _currentStatus;};
Finder* getFinderFrom(HWND hwnd);
int regexBackwardMsgBox();
protected :
@ -445,6 +444,7 @@ private:
HWND _shiftTrickUpTip = nullptr;
HWND _2ButtonsTip = nullptr;
HWND _filterTip = nullptr;
HWND _dirFromActiveDocTip = nullptr;
bool _isRTL = false;

View File

@ -37,8 +37,7 @@ BEGIN
RTEXT "Dir&ectory:",IDD_FINDINFILES_DIR_STATIC,7,76,41,8
COMBOBOX IDD_FINDINFILES_DIR_COMBO,50,74,196,150,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "...",IDD_FINDINFILES_BROWSE_BUTTON,250,73,16,14
CONTROL "Follow current doc.",IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,78,94,10
PUSHBUTTON "<<",IDD_FINDINFILES_SETDIRFROMDOC_BUTTON,266,73,16,14
CONTROL "In all su&b-folders",IDD_FINDINFILES_RECURSIVE_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,90,94,10
CONTROL "In &hidden folders",IDD_FINDINFILES_INHIDDENDIR_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,102,94,10

View File

@ -85,7 +85,7 @@
#define IDD_FINDINFILES_INHIDDENDIR_CHECK 1659
#define IDF_FINDINFILES_INHIDDENDIR_CHECK 64
#define IDD_FINDINFILES_REPLACEINFILES 1660
#define IDD_FINDINFILES_FOLDERFOLLOWSDOC_CHECK 1661
#define IDD_FINDINFILES_SETDIRFROMDOC_BUTTON 1661
#define IDD_FINDINFILES_PROJECT1_CHECK 1662
#define IDF_FINDINFILES_PROJECT1_CHECK 128
#define IDD_FINDINFILES_PROJECT2_CHECK 1663

View File

@ -379,25 +379,24 @@ BEGIN
EDITTEXT IDC_EDIT_VIEWPANEL,158,161,280,12,ES_AUTOHSCROLL | ES_READONLY
END
IDD_PREFERENCE_SUB_SEARCHING DIALOGEX 115, 10, 460, 205
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "When Find Dialog is Invoked", IDD_FILL_FIND_FIELD_GRP_STATIC, 31, 4, 323, 65, BS_CENTER
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "When Find Dialog is Invoked", IDD_FILL_FIND_FIELD_GRP_STATIC, 31, 4, 323, 85, BS_CENTER
RTEXT "Minimum Size for Auto-Checking ""In selection"":", IDC_INSELECTION_THRESHOLD_STATIC, 37, 16, 210, 8
PUSHBUTTON "?",IDC_INSELECTION_THRESH_QUESTION_BUTTON,283,14,16,14,NOT WS_TABSTOP
EDITTEXT IDC_INSELECTION_THRESHOLD_EDIT, 250, 15, 27, 12, ES_CENTER | ES_NUMBER | WS_TABSTOP
CONTROL "Fill Find Field with Selected Text", IDC_CHECK_FILL_FIND_FIELD_WITH_SELECTED, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 38, 275, 10
CONTROL "Select Word Under Caret when Nothing Selected", IDC_CHECK_FILL_FIND_FIELD_SELECT_CARET, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 52, 53, 275, 10
CONTROL "Use Monospaced font in Find dialog (Need to restart Notepad++)", IDC_CHECK_MONOSPACEDFONT_FINDDLG, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 74, 350, 10
CONTROL "Find dialog remains open after search that outputs to results window", IDC_CHECK_FINDDLG_ALWAYS_VISIBLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 89, 350, 10
CONTROL "Confirm Replace All in All Opened Documents", IDC_CHECK_CONFIRMREPLOPENDOCS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 104, 350, 10
CONTROL "Replace: Don't move to the following occurrence", IDC_CHECK_REPLACEANDSTOP, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 119, 350, 10
CONTROL "Search Result window: show only one entry per found line if possible", IDC_CHECK_SHOWONCEPERFOUNDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 134, 350, 10
PUSHBUTTON "?", IDC_INSELECTION_THRESH_QUESTION_BUTTON, 283, 14, 16, 14, NOT WS_TABSTOP
EDITTEXT IDC_INSELECTION_THRESHOLD_EDIT, 250, 15, 27, 12, ES_CENTER | ES_NUMBER
CONTROL "Fill Find Field with Selected Text", IDC_CHECK_FILL_FIND_FIELD_WITH_SELECTED, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 59, 300, 10
CONTROL "Select Word Under Caret when Nothing Selected", IDC_CHECK_FILL_FIND_FIELD_SELECT_CARET, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 52, 73, 275, 10
CONTROL "Fill Find in Files Directory Field Based On Active Document", IDC_CHECK_FILL_DIR_FIELD_FROM_ACTIVE_DOC, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 44, 311, 8
CONTROL "Use Monospaced font in Find dialog (Need to restart Notepad++)", IDC_CHECK_MONOSPACEDFONT_FINDDLG, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 104, 350, 10
CONTROL "Find dialog remains open after search that outputs to results window", IDC_CHECK_FINDDLG_ALWAYS_VISIBLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 119, 350, 10
CONTROL "Confirm Replace All in All Opened Documents", IDC_CHECK_CONFIRMREPLOPENDOCS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 134, 350, 10
CONTROL "Replace: Don't move to the following occurrence", IDC_CHECK_REPLACEANDSTOP, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 149, 350, 10
CONTROL "Search Result window: show only one entry per found line if possible", IDC_CHECK_SHOWONCEPERFOUNDLINE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 164, 350, 10
END
IDD_PREFERENCE_SUB_BACKUP DIALOGEX 115, 10, 460, 205
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1

View File

@ -6155,6 +6155,7 @@ intptr_t CALLBACK SearchingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
::SendDlgItemMessage(_hSelf, IDC_CHECK_REPLACEANDSTOP, BM_SETCHECK, nppGUI._replaceStopsWithoutFindingNext, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_SHOWONCEPERFOUNDLINE, BM_SETCHECK, nppGUI._finderShowOnlyOneEntryPerFoundLine, 0);
::SetDlgItemInt(_hSelf, IDC_INSELECTION_THRESHOLD_EDIT, nppGUI._inSelectionAutocheckThreshold, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_FILL_DIR_FIELD_FROM_ACTIVE_DOC, BM_SETCHECK, nppGUI._fillDirFieldFromActiveDoc, 0);
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
wstring tipText = pNativeSpeaker->getLocalizedStrFromID("searchingInSelThresh-tip", L"Number of selected characters in edit zone to automatically check the \"In selection\" checkbox when the Find dialog is activated. The maximum value is 1024. Set the value to 0 to disable auto-checking.");
@ -6282,6 +6283,13 @@ intptr_t CALLBACK SearchingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
}
break;
case IDC_CHECK_FILL_DIR_FIELD_FROM_ACTIVE_DOC:
{
nppGUI._fillDirFieldFromActiveDoc = isCheckedOrNot(IDC_CHECK_FILL_DIR_FIELD_FROM_ACTIVE_DOC);
return TRUE;
}
break;
default:
return FALSE;
}

View File

@ -452,6 +452,7 @@
#define IDC_INSELECTION_THRESHOLD_STATIC (IDD_PREFERENCE_SUB_SEARCHING + 10)
#define IDC_INSELECTION_THRESHOLD_EDIT (IDD_PREFERENCE_SUB_SEARCHING + 11)
#define IDC_INSELECTION_THRESH_QUESTION_BUTTON (IDD_PREFERENCE_SUB_SEARCHING + 12)
#define IDC_CHECK_FILL_DIR_FIELD_FROM_ACTIVE_DOC (IDD_PREFERENCE_SUB_SEARCHING + 13)
#define IDD_PREFERENCE_SUB_DARKMODE 7100 //(IDD_PREFERENCE_BOX + 1100)
//#define IDC_CHECK_DARKMODE_ENABLE (IDD_PREFERENCE_SUB_DARKMODE + 1)