mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
feat: prep for grepWin search pattern editcmd patching
This commit is contained in:
parent
a0dc1496bf
commit
c155d710d1
@ -341,7 +341,7 @@ BEGIN
|
||||
LTEXT "&Einrückung Tiefe:",IDC_STATIC2,7,30,60,8
|
||||
EDITTEXT IDC_INDENT_DEPTH,67,27,30,14,ES_AUTOHSCROLL
|
||||
CONTROL "Tabulatoren als &Leerzeichenfolge einfügen",IDC_TAB_AS_SPC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,47,160,10
|
||||
CONTROL "Tab/Backspace always indents",IDC_TAB_BACKTAB_INDENTS_ALWAYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,59,150,10
|
||||
CONTROL "Tab/Shift-Tab formatiert immer die Einrückung",IDC_TAB_BACKTAB_INDENTS_ALWAYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,59,150,10
|
||||
CONTROL "Tab-Taste formatiert die Einrückung",IDC_TAB_INDENTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,71,160,10
|
||||
CONTROL "&Rück-Taste formatiert die Einrückung",IDC_BACKTAB_INDENTS,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,83,160,10
|
||||
|
||||
@ -483,7 +483,7 @@ BEGIN
|
||||
MENUITEM "Nachricht bei &Dateiänderung...\tAlt+F5", IDM_SET_CHANGENOTIFY
|
||||
///MENUITEM "Auto-Speichern / Backup Einstellungen...", IDM_SET_AUTOSAVE_BACKUP
|
||||
MENUITEM "Keine Nachrichten &Beeps", IDM_SET_MUTE_MESSAGEBEEP
|
||||
MENUITEM "Resolve to &UNC-Paths", IDM_SET_RESOLVE_UNC_PATHS
|
||||
MENUITEM "Zu &UNC-Pfad auflösen", IDM_SET_RESOLVE_UNC_PATHS
|
||||
POPUP "Esc-&Key Funktion"
|
||||
BEGIN
|
||||
MENUITEM "&Keine", IDM_SET_NOESCFUNC
|
||||
@ -493,10 +493,10 @@ BEGIN
|
||||
MENUITEM "Speichern vor Werkzeug Start", IDM_SET_SAVEBEFORERUNNINGTOOLS
|
||||
MENUITEM "Berechne Tiny-Expressions", IDM_SET_EVALTINYEXPRONSEL
|
||||
MENUITEM "Erlaube Mehrfach Selektion", IDM_SET_MULTIPLE_SELECTION
|
||||
POPUP "Default &Directory"
|
||||
POPUP "Standard &Verzeichnis"
|
||||
BEGIN
|
||||
MENUITEM "Set to Current File's &Directory", IDM_SET_DEFAULTDIR
|
||||
MENUITEM "&Reset to Default", IDM_SET_DEFAULTDIR_RESET
|
||||
MENUITEM "Aktuelles &Verzeichnis als Standard", IDM_SET_DEFAULTDIR
|
||||
MENUITEM "&Zurücksetzen auf Voreinstellung", IDM_SET_DEFAULTDIR_RESET
|
||||
END
|
||||
MENUITEM SEPARATOR
|
||||
POPUP "&Erinnern an"
|
||||
|
||||
@ -131,12 +131,12 @@ BEGIN
|
||||
IDS_MUI_ERR_SAVEFILE "Error saving ""%s"""
|
||||
IDS_MUI_ERR_PATHNOTFOUND "The path for ""%s"" no longer exists.\nRecreate the path and save the file?"
|
||||
IDS_MUI_ERR_DLG_FORMAT "Error '%s', cause:\n%s(ID:%d)\n"
|
||||
IDS_MUI_ERR_BROWSE "No file browser plugin was found\nThe MiniPath file browser plugin can be downloaded from https://rizonesoft.com"
|
||||
IDS_MUI_ERR_GREPWIN "No file search plugin was found\nThe grepWin Portable file search plugin can be downloaded from https://github.com/stefankueng/grepWin/releases"
|
||||
IDS_MUI_ERR_BROWSE "Es wurde kein Datei-Browser Plugin gefunden\nDas MiniPath Datei-Browser Plugin kann hier herunter geladen werden: https://rizonesoft.com"
|
||||
IDS_MUI_ERR_GREPWIN "Es wurde kein Datei-Inhaltsuche Tool gefunden\nDas grepWin Portable Datei-Inhaltsuche Tool kann hier herunter geladen werden: https://github.com/stefankueng/grepWin/releases"
|
||||
IDS_MUI_ERR_GREPWIN_PORTAPPS
|
||||
"No file search plugin was found\nPlease install the latest version of grepWinPortable in PortableApps Platform."
|
||||
IDS_MUI_ERR_MRUDLG "No access to the selected file!\nWould you like to remove it from the list?"
|
||||
IDS_MUI_ERR_CREATELINK "Error creating the Desktop link"
|
||||
"Es wurde kein Datei-Inhaltsuche Tool gefunden\nBitte die neueste Version von grepWinPortable in der PortableApps Platform installieren."
|
||||
IDS_MUI_ERR_MRUDLG "Keine Zugriff auf die selektierte Datei!\nSoll dieser Eintrag aus der Liste entfernt werden?"
|
||||
IDS_MUI_ERR_CREATELINK "Fehler beim Erzeugen der Desktop Verknüpfung"
|
||||
IDS_MUI_ERR_PREVWINDISABLED
|
||||
"Die existierende Notepad3-Instanz ist entweder beschäftigt oder hat eine geöffnete Dialogbox\nMöchtest Du eine andere Notepad3-Instanz öffnen?"
|
||||
IDS_MUI_ERR_ENCODINGNA "Die Code-Page Konvertierungstabellen sind für die ausgewählte Codierung auf diesem System nicht vorhanden"
|
||||
|
||||
@ -5125,6 +5125,7 @@ void DialogGrepWin(HWND hwnd, LPCWSTR searchPattern)
|
||||
Path_GetModuleFilePath(hpath_np3);
|
||||
|
||||
StringCchPrintf(value, COUNTOF(value), L"%s /g %%line%% - %%path%%", Path_Get(hpath_np3));
|
||||
//@@@StringCchPrintf(value, COUNTOF(value), L"%s /g %%line%% /mr \"%%pattern%%\" - %%path%%", Path_Get(hpath_np3));
|
||||
IniSectionSetString(globalSection, L"editorcmd", value);
|
||||
|
||||
Path_Release(hpath_np3);
|
||||
|
||||
58
src/Edit.c
58
src/Edit.c
@ -6604,18 +6604,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
SetWindowSubclass(cbInfoF.hwndItem, EditBoxForPasteFixes, 0, (DWORD_PTR) &(s_wchBufOut[0]));
|
||||
SHAutoComplete(cbInfoF.hwndItem, SHACF_FILESYS_ONLY | SHACF_AUTOAPPEND_FORCE_OFF | SHACF_AUTOSUGGEST_FORCE_OFF);
|
||||
}
|
||||
if (!GetWindowTextLengthW(GetDlgItem(hwnd, IDC_FINDTEXT))) {
|
||||
if (StrgIsNotEmpty(s_pEfrData->chFindPattern)) {
|
||||
ComboBox_SetTextHW(hwnd, IDC_FINDTEXT, s_pEfrData->chFindPattern);
|
||||
}
|
||||
else if (MRU_Count(Globals.pMRUfind)) {
|
||||
MRU_Enum(Globals.pMRUfind, 0, s_wchBufOut, COUNTOF(s_wchBufOut));
|
||||
ComboBox_SetTextW(hwnd, IDC_FINDTEXT, s_wchBufOut);
|
||||
}
|
||||
else {
|
||||
ComboBox_SetTextW(hwnd, IDC_FINDTEXT, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_bIsReplaceDlg) {
|
||||
|
||||
@ -6634,20 +6622,12 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
SetWindowSubclass(cbInfoR.hwndItem, EditBoxForPasteFixes, 0, (DWORD_PTR) &(s_wchBufOut[0]));
|
||||
SHAutoComplete(cbInfoR.hwndItem, SHACF_FILESYS_ONLY | SHACF_AUTOAPPEND_FORCE_OFF | SHACF_AUTOSUGGEST_FORCE_OFF);
|
||||
}
|
||||
if (!GetWindowTextLengthW(GetDlgItem(hwnd, IDC_REPLACETEXT))) {
|
||||
if (StrgIsNotEmpty(s_pEfrData->chReplaceTemplate)) {
|
||||
ComboBox_SetTextHW(hwnd, IDC_REPLACETEXT, s_pEfrData->chReplaceTemplate);
|
||||
}
|
||||
else if (MRU_Count(Globals.pMRUreplace)) {
|
||||
MRU_Enum(Globals.pMRUreplace, 0, s_wchBufOut, COUNTOF(s_wchBufOut));
|
||||
ComboBox_SetTextW(hwnd, IDC_REPLACETEXT, s_wchBufOut);
|
||||
}
|
||||
else {
|
||||
ComboBox_SetTextW(hwnd, IDC_REPLACETEXT, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize all checkboxes BEFORE setting combobox text.
|
||||
// Setting combobox text triggers CBN_EDITCHANGE synchronously,
|
||||
// which calls _SetSearchFlags() that reads checkbox states.
|
||||
// Checkboxes must reflect s_pEfrData values at that point.
|
||||
CheckDlgButton(hwnd, IDC_FINDREGEXP, SetBtn(s_pEfrData->bRegExprSearch));
|
||||
|
||||
bool const bDotMatchAll = (s_pEfrData->fuFlags & SCFIND_DOT_MATCH_ALL) != 0;
|
||||
@ -6686,6 +6666,36 @@ static INT_PTR CALLBACK EditFindReplaceDlgProc(HWND hwnd, UINT umsg, WPARAM wPar
|
||||
|
||||
CheckDlgButton(hwnd, IDC_TRANSPARENT, SetBtn(Settings.FindReplaceTransparentMode));
|
||||
|
||||
// Now set combobox text — CBN_EDITCHANGE will fire and call
|
||||
// _SetSearchFlags(), which can now read the correct checkbox states.
|
||||
if (!GetWindowTextLengthW(GetDlgItem(hwnd, IDC_FINDTEXT))) {
|
||||
if (StrgIsNotEmpty(s_pEfrData->chFindPattern)) {
|
||||
ComboBox_SetTextHW(hwnd, IDC_FINDTEXT, s_pEfrData->chFindPattern);
|
||||
}
|
||||
else if (MRU_Count(Globals.pMRUfind)) {
|
||||
MRU_Enum(Globals.pMRUfind, 0, s_wchBufOut, COUNTOF(s_wchBufOut));
|
||||
ComboBox_SetTextW(hwnd, IDC_FINDTEXT, s_wchBufOut);
|
||||
}
|
||||
else {
|
||||
ComboBox_SetTextW(hwnd, IDC_FINDTEXT, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (s_bIsReplaceDlg) {
|
||||
if (!GetWindowTextLengthW(GetDlgItem(hwnd, IDC_REPLACETEXT))) {
|
||||
if (StrgIsNotEmpty(s_pEfrData->chReplaceTemplate)) {
|
||||
ComboBox_SetTextHW(hwnd, IDC_REPLACETEXT, s_pEfrData->chReplaceTemplate);
|
||||
}
|
||||
else if (MRU_Count(Globals.pMRUreplace)) {
|
||||
MRU_Enum(Globals.pMRUreplace, 0, s_wchBufOut, COUNTOF(s_wchBufOut));
|
||||
ComboBox_SetTextW(hwnd, IDC_REPLACETEXT, s_wchBufOut);
|
||||
}
|
||||
else {
|
||||
ComboBox_SetTextW(hwnd, IDC_REPLACETEXT, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (s_bSwitchedFindReplace) {
|
||||
// restore from prev Dlg
|
||||
SetDlgPos(hwnd, s_xFindReplaceDlgSave, s_yFindReplaceDlgSave);
|
||||
|
||||
@ -5772,7 +5772,8 @@ static bool _HandleEditFind(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_FIND: {
|
||||
SetFindReplaceData(); // s_FindReplaceData
|
||||
if (!IsWindow(Globals.hwndDlgFindReplace)) {
|
||||
Globals.bFindReplCopySelOrClip = true;
|
||||
// Don't overwrite cmd-line search pattern with editor selection
|
||||
Globals.bFindReplCopySelOrClip = !g_flagMatchText;
|
||||
/*Globals.hwndDlgFindReplace =*/ EditFindReplaceDlg(Globals.hwndEdit, &s_FindReplaceData, false);
|
||||
} else {
|
||||
Globals.bFindReplCopySelOrClip = (GetForegroundWindow() != Globals.hwndDlgFindReplace);
|
||||
@ -5792,7 +5793,8 @@ static bool _HandleEditFind(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_REPLACE: {
|
||||
SetFindReplaceData(); // s_FindReplaceData
|
||||
if (!IsWindow(Globals.hwndDlgFindReplace)) {
|
||||
Globals.bFindReplCopySelOrClip = true;
|
||||
// Don't overwrite cmd-line search pattern with editor selection
|
||||
Globals.bFindReplCopySelOrClip = !g_flagMatchText;
|
||||
/*Globals.hwndDlgFindReplace =*/ EditFindReplaceDlg(Globals.hwndEdit, &s_FindReplaceData, true);
|
||||
} else {
|
||||
Globals.bFindReplCopySelOrClip = (GetForegroundWindow() != Globals.hwndDlgFindReplace);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user