Skip to content

Commit

Permalink
Rework FIF Follow-current-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alankilborn committed Dec 11, 2024
1 parent 4972dcf commit d286520
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 45 deletions.
3 changes: 2 additions & 1 deletion PowerEditor/installer/nativeLang/english.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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"/>
Expand Down
3 changes: 2 additions & 1 deletion PowerEditor/installer/nativeLang/english_customizable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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"/>
Expand Down
3 changes: 2 additions & 1 deletion PowerEditor/src/Notepad_plus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6926,10 +6926,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();
}
Expand Down
4 changes: 2 additions & 2 deletions PowerEditor/src/NppBigSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,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]{};
Expand Down
12 changes: 7 additions & 5 deletions PowerEditor/src/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2782,10 +2782,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)
Expand Down Expand Up @@ -6160,6 +6156,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"))
{
Expand Down Expand Up @@ -7725,6 +7727,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="" />
Expand Down Expand Up @@ -7852,7 +7855,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);
Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ struct NppGUI final
bool _confirmReplaceInAllOpenDocs = true;
bool _replaceStopsWithoutFindingNext = false;
int _inSelectionAutocheckThreshold = FINDREPLACE_INSELECTION_THRESHOLD_DEFAULT;
bool _fillDirFieldFromActiveDoc = true;
bool _muteSounds = false;
bool _enableFoldCmdToggable = false;
bool _hideMenuRightShortcuts = false;
Expand Down Expand Up @@ -1243,7 +1244,6 @@ struct FindHistory final
int _transparency = 150;

bool _isFilterFollowDoc = false;
bool _isFolderFollowDoc = false;

bool _isBookmarkLine = false;
bool _isPurge = false;
Expand Down
52 changes: 28 additions & 24 deletions PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ FindReplaceDlg::~FindReplaceDlg()
if (_2ButtonsTip)
::DestroyWindow(_2ButtonsTip);

if (_dirBrowserTip)
::DestroyWindow(_dirBrowserTip);

if (_dirFromActiveDocTip)
::DestroyWindow(_dirFromActiveDocTip);

if (_filterTip)
::DestroyWindow(_filterTip);

Expand Down Expand Up @@ -383,7 +389,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);
Expand Down Expand Up @@ -1216,14 +1221,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 = {
Expand Down Expand Up @@ -1502,7 +1507,9 @@ 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(_dirBrowserTip, NppDarkMode::ToolTipsType::tooltip);
NppDarkMode::setDarkTooltips(_dirFromActiveDocTip, NppDarkMode::ToolTipsType::tooltip);

if (_statusbarTooltipWnd)
{
NppDarkMode::setDarkTooltips(_statusbarTooltipWnd, NppDarkMode::ToolTipsType::tooltip);
Expand Down Expand Up @@ -1587,6 +1594,12 @@ 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 dirBrowserTip = pNativeSpeaker->getLocalizedStrFromID("find-in-files-select-folder", L"Select a folder to search from");
_dirBrowserTip = CreateToolTip(IDD_FINDINFILES_BROWSE_BUTTON, _hSelf, _hInst, const_cast<PTSTR>(dirBrowserTip.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");

Expand Down Expand Up @@ -2661,28 +2674,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;

Expand Down Expand Up @@ -4025,7 +4029,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)
Expand Down
3 changes: 2 additions & 1 deletion PowerEditor/src/ScintillaComponent/FindReplaceDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ public :
bool removeFinder(Finder *finder2remove);
DIALOG_TYPE getCurrentStatus() {return _currentStatus;};
Finder* getFinderFrom(HWND hwnd);

int regexBackwardMsgBox();

protected :
Expand Down Expand Up @@ -445,6 +444,8 @@ protected :
HWND _shiftTrickUpTip = nullptr;
HWND _2ButtonsTip = nullptr;
HWND _filterTip = nullptr;
HWND _dirBrowserTip = nullptr;
HWND _dirFromActiveDocTip = nullptr;

bool _isRTL = false;

Expand Down
3 changes: 1 addition & 2 deletions PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion PowerEditor/src/ScintillaComponent/FindReplaceDlg_rc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions PowerEditor/src/WinControls/Preference/preference.rc
Original file line number Diff line number Diff line change
Expand Up @@ -384,17 +384,18 @@ 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
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
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, 75, 350, 10
CONTROL "Use Monospaced font in Find dialog (Need to restart Notepad++)", IDC_CHECK_MONOSPACEDFONT_FINDDLG, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 37, 134, 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


Expand Down
8 changes: 8 additions & 0 deletions PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions PowerEditor/src/WinControls/Preference/preference_rc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d286520

Please sign in to comment.