mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #1935 from RaiKoHoff/DevNewFeatures
separate auto esc'd control chars from "transform backslashes"
This commit is contained in:
commit
854f7778e8
@ -236,117 +236,118 @@
|
||||
#define IDC_FINDWORD 18005
|
||||
#define IDC_FINDSTART 18006
|
||||
#define IDC_FINDTRANSFORMBS 18007
|
||||
#define IDC_FINDREGEXP 18008
|
||||
#define IDC_DOT_MATCH_ALL 18009
|
||||
#define IDC_NOWRAP 18010
|
||||
#define IDC_FINDCLOSE 18011
|
||||
#define IDC_ALL_OCCURRENCES 18012
|
||||
#define IDC_WILDCARDSEARCH 18013
|
||||
#define IDC_FINDPREV 18014
|
||||
#define IDC_REPLACE 18015
|
||||
#define IDC_REPLACEINSEL 18016
|
||||
#define IDC_REPLACEALL 18017
|
||||
#define IDC_SWAPSTRG 18018
|
||||
#define IDC_TOGGLEFINDREPLACE 18019
|
||||
#define IDC_BACKSLASHHELP 18020
|
||||
#define IDC_REGEXPHELP 18021
|
||||
#define IDC_WILDCARDHELP 18022
|
||||
#define IDS_FR_STATUS_TEXT 18023
|
||||
#define IDC_TOGGLE_VISIBILITY 18024
|
||||
#define IDC_OPENWITHDIR 18025
|
||||
#define IDC_GETOPENWITHDIR 18026
|
||||
#define IDC_OPENWITHDESCR 18027
|
||||
#define IDC_RESIZEGRIP 18028
|
||||
#define IDC_ENCODINGLIST 18029
|
||||
#define IDC_USEASREADINGFALLBACK 18030
|
||||
#define IDC_NOANSICPDETECTION 18031
|
||||
#define IDC_NOUNICODEDETECTION 18032
|
||||
#define IDC_ASCIIASUTF8 18033
|
||||
#define IDC_NFOASOEM 18034
|
||||
#define IDC_ENCODINGFROMFILEVARS 18035
|
||||
#define IDC_EOLMODELIST 18036
|
||||
#define IDC_WARN_INCONSISTENT_EOLS 18037
|
||||
#define IDC_CONSISTENT_EOLS 18038
|
||||
#define IDC_FINDAUTOESCCTRLCHR 18008
|
||||
#define IDC_FINDREGEXP 18009
|
||||
#define IDC_DOT_MATCH_ALL 18010
|
||||
#define IDC_NOWRAP 18011
|
||||
#define IDC_FINDCLOSE 18012
|
||||
#define IDC_ALL_OCCURRENCES 18013
|
||||
#define IDC_WILDCARDSEARCH 18014
|
||||
#define IDC_FINDPREV 18015
|
||||
#define IDC_REPLACE 18016
|
||||
#define IDC_REPLACEINSEL 18017
|
||||
#define IDC_REPLACEALL 18018
|
||||
#define IDC_SWAPSTRG 18019
|
||||
#define IDC_TOGGLEFINDREPLACE 18020
|
||||
#define IDC_BACKSLASHHELP 18021
|
||||
#define IDC_REGEXPHELP 18022
|
||||
#define IDC_WILDCARDHELP 18023
|
||||
#define IDS_FR_STATUS_TEXT 18024
|
||||
#define IDC_TOGGLE_VISIBILITY 18025
|
||||
#define IDC_OPENWITHDIR 18026
|
||||
#define IDC_GETOPENWITHDIR 18027
|
||||
#define IDC_OPENWITHDESCR 18028
|
||||
#define IDC_RESIZEGRIP 18029
|
||||
#define IDC_ENCODINGLIST 18030
|
||||
#define IDC_USEASREADINGFALLBACK 18031
|
||||
#define IDC_NOANSICPDETECTION 18032
|
||||
#define IDC_NOUNICODEDETECTION 18033
|
||||
#define IDC_ASCIIASUTF8 18034
|
||||
#define IDC_NFOASOEM 18035
|
||||
#define IDC_ENCODINGFROMFILEVARS 18036
|
||||
#define IDC_EOLMODELIST 18037
|
||||
#define IDC_WARN_INCONSISTENT_EOLS 18038
|
||||
#define IDC_CONSISTENT_EOLS 18039
|
||||
// keep order (CRLF(0), CR(1), LF(2))
|
||||
#define IDC_EOL_SUM_CRLF 18039
|
||||
#define IDC_EOL_SUM_CR 18040
|
||||
#define IDC_EOL_SUM_LF 18041
|
||||
#define IDC_AUTOSTRIPBLANKS 18042
|
||||
#define IDC_LINENUM 18043
|
||||
#define IDC_COLNUM 18044
|
||||
#define IDC_FILEMRU 18045
|
||||
#define IDC_PRESERVECARET 18046
|
||||
#define IDC_SAVEMRU 18047
|
||||
#define IDC_REMOVE 18048
|
||||
#define IDC_REMEMBERSEARCHPATTERN 18049
|
||||
#define IDC_STYLELIST 18050
|
||||
#define IDC_DEFAULTSCHEME 18051
|
||||
#define IDC_AUTOSELECT 18052
|
||||
#define IDC_STYLELABEL_ROOT 18053
|
||||
#define IDC_STYLEEDIT_ROOT 18054
|
||||
#define IDC_STYLELABEL 18055
|
||||
#define IDC_STYLEFORE 18056
|
||||
#define IDC_STYLEBACK 18057
|
||||
#define IDC_STYLEFONT 18058
|
||||
#define IDC_PREVIEW 18059
|
||||
#define IDC_STYLEDEFAULT 18060
|
||||
#define IDC_PREVSTYLE 18061
|
||||
#define IDC_NEXTSTYLE 18062
|
||||
#define IDC_IMPORT 18063
|
||||
#define IDC_EXPORT 18064
|
||||
#define IDC_TITLE 18065
|
||||
#define IDC_STYLEEDIT 18066
|
||||
#define IDC_PRINTER 18067
|
||||
#define IDC_FAVORITESDIR 18068
|
||||
#define IDC_GETFAVORITESDIR 18069
|
||||
#define IDC_FAVORITESDESCR 18070
|
||||
#define IDC_PWD_EDIT1 18071
|
||||
#define IDC_PWD_EDIT2 18072
|
||||
#define IDC_PWD_EDIT3 18073
|
||||
#define IDC_PWD_CHECK1 18074
|
||||
#define IDC_PWD_CHECK2 18075
|
||||
#define IDC_PWD_CHECK3 18076
|
||||
#define IDC_PWD_CHECK4 18077
|
||||
#define IDC_PWD_STATMPW 18078
|
||||
#define IDC_COLUMNWRAP 18079
|
||||
#define IDC_INFOBOXTEXT 18080
|
||||
#define IDC_INFOBOXCHECK 18081
|
||||
#define IDC_INFOBOXICON 18082
|
||||
#define IDC_VERSION 18083
|
||||
#define IDC_SCI_VERSION 18084
|
||||
#define IDC_COMPILER 18085
|
||||
#define IDC_COPYRIGHT 18086
|
||||
#define IDC_WEBPAGE2 18087
|
||||
#define IDC_WEBPAGE 18088
|
||||
#define IDR_RIZBITMAP 18089
|
||||
#define IDC_RIZONEBMP 18090
|
||||
#define IDC_COPYVERSTRG 18091
|
||||
#define IDC_RICHEDITABOUT 18092
|
||||
#define IDC_TRANSL_AUTH 18093
|
||||
#define IDC_TRANSPARENT 18094
|
||||
#define IDC_TAB_WIDTH 18095
|
||||
#define IDC_INDENT_DEPTH 18096
|
||||
#define IDC_TAB_AS_SPC 18097
|
||||
#define IDC_TAB_INDENTS 18098
|
||||
#define IDC_BACKTAB_INDENTS 18099
|
||||
#define IDC_WARN_INCONSISTENT_INDENTS 18100
|
||||
#define IDC_AUTO_DETECT_INDENTS 18101
|
||||
#define IDC_CMDLINEHELP 18102
|
||||
#define IDC_STYLEEDIT_HELP 18103
|
||||
#define IDC_RELIABLE_DETECTION_RES 18104
|
||||
#define IDC_LINE_TEXT 18105
|
||||
#define IDC_COLUMN_TEXT 18106
|
||||
#define IDC_INDENT_WIDTH_TAB 18107
|
||||
#define IDC_INDENT_WIDTH_SPC 18108
|
||||
#define IDC_INDENT_SUM_TAB 18109
|
||||
#define IDC_INDENT_SUM_SPC 18110
|
||||
#define IDC_INDENT_SUM_MIX 18111
|
||||
#define IDC_INDENT_BY_TABS 18112
|
||||
#define IDC_INDENT_BY_SPCS 18113
|
||||
#define IDC_INDENT_TAB_MODX 18114
|
||||
#define IDC_INDENT_SPC_MODX 18115
|
||||
#define IDC_ADDFAV_FILES 18116
|
||||
#define IDC_INFO_GROUPBOX 18117
|
||||
#define IDC_EOL_SUM_CRLF 18040
|
||||
#define IDC_EOL_SUM_CR 18041
|
||||
#define IDC_EOL_SUM_LF 18042
|
||||
#define IDC_AUTOSTRIPBLANKS 18043
|
||||
#define IDC_LINENUM 18044
|
||||
#define IDC_COLNUM 18045
|
||||
#define IDC_FILEMRU 18046
|
||||
#define IDC_PRESERVECARET 18047
|
||||
#define IDC_SAVEMRU 18048
|
||||
#define IDC_REMOVE 18049
|
||||
#define IDC_REMEMBERSEARCHPATTERN 18050
|
||||
#define IDC_STYLELIST 18051
|
||||
#define IDC_DEFAULTSCHEME 18052
|
||||
#define IDC_AUTOSELECT 18053
|
||||
#define IDC_STYLELABEL_ROOT 18054
|
||||
#define IDC_STYLEEDIT_ROOT 18055
|
||||
#define IDC_STYLELABEL 18056
|
||||
#define IDC_STYLEFORE 18057
|
||||
#define IDC_STYLEBACK 18058
|
||||
#define IDC_STYLEFONT 18059
|
||||
#define IDC_PREVIEW 18060
|
||||
#define IDC_STYLEDEFAULT 18061
|
||||
#define IDC_PREVSTYLE 18062
|
||||
#define IDC_NEXTSTYLE 18063
|
||||
#define IDC_IMPORT 18064
|
||||
#define IDC_EXPORT 18065
|
||||
#define IDC_TITLE 18066
|
||||
#define IDC_STYLEEDIT 18067
|
||||
#define IDC_PRINTER 18068
|
||||
#define IDC_FAVORITESDIR 18069
|
||||
#define IDC_GETFAVORITESDIR 18070
|
||||
#define IDC_FAVORITESDESCR 18071
|
||||
#define IDC_PWD_EDIT1 18072
|
||||
#define IDC_PWD_EDIT2 18073
|
||||
#define IDC_PWD_EDIT3 18074
|
||||
#define IDC_PWD_CHECK1 18075
|
||||
#define IDC_PWD_CHECK2 18076
|
||||
#define IDC_PWD_CHECK3 18077
|
||||
#define IDC_PWD_CHECK4 18078
|
||||
#define IDC_PWD_STATMPW 18079
|
||||
#define IDC_COLUMNWRAP 18080
|
||||
#define IDC_INFOBOXTEXT 18081
|
||||
#define IDC_INFOBOXCHECK 18082
|
||||
#define IDC_INFOBOXICON 18083
|
||||
#define IDC_VERSION 18084
|
||||
#define IDC_SCI_VERSION 18085
|
||||
#define IDC_COMPILER 18086
|
||||
#define IDC_COPYRIGHT 18087
|
||||
#define IDC_WEBPAGE2 18088
|
||||
#define IDC_WEBPAGE 18089
|
||||
#define IDR_RIZBITMAP 18090
|
||||
#define IDC_RIZONEBMP 18091
|
||||
#define IDC_COPYVERSTRG 18092
|
||||
#define IDC_RICHEDITABOUT 18093
|
||||
#define IDC_TRANSL_AUTH 18094
|
||||
#define IDC_TRANSPARENT 18095
|
||||
#define IDC_TAB_WIDTH 18096
|
||||
#define IDC_INDENT_DEPTH 18097
|
||||
#define IDC_TAB_AS_SPC 18098
|
||||
#define IDC_TAB_INDENTS 18099
|
||||
#define IDC_BACKTAB_INDENTS 18100
|
||||
#define IDC_WARN_INCONSISTENT_INDENTS 18101
|
||||
#define IDC_AUTO_DETECT_INDENTS 18102
|
||||
#define IDC_CMDLINEHELP 18103
|
||||
#define IDC_STYLEEDIT_HELP 18104
|
||||
#define IDC_RELIABLE_DETECTION_RES 18105
|
||||
#define IDC_LINE_TEXT 18106
|
||||
#define IDC_COLUMN_TEXT 18107
|
||||
#define IDC_INDENT_WIDTH_TAB 18108
|
||||
#define IDC_INDENT_WIDTH_SPC 18109
|
||||
#define IDC_INDENT_SUM_TAB 18110
|
||||
#define IDC_INDENT_SUM_SPC 18111
|
||||
#define IDC_INDENT_SUM_MIX 18112
|
||||
#define IDC_INDENT_BY_TABS 18113
|
||||
#define IDC_INDENT_BY_SPCS 18114
|
||||
#define IDC_INDENT_TAB_MODX 18115
|
||||
#define IDC_INDENT_SPC_MODX 18116
|
||||
#define IDC_ADDFAV_FILES 18117
|
||||
#define IDC_INFO_GROUPBOX 18118
|
||||
|
||||
#define CMD_ESCAPE 20000
|
||||
#define CMD_SHIFTESC 20001
|
||||
|
||||
@ -91,6 +91,7 @@ BEGIN
|
||||
CONTROL "Nur ganze &Wörter",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,110,10
|
||||
CONTROL "Nur Wort-&Anfänge",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,110,10
|
||||
CONTROL "&Transformiere Backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,73,90,10
|
||||
CONTROL "&Auto Esc Ctrl Zeichen", IDC_FINDAUTOESCCTRLCHR, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 125, 73, 85, 10
|
||||
CONTROL "&Regulärer &Ausdruck",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,96,10
|
||||
CONTROL "&Punkt ersetzt Alle",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,65,10
|
||||
CONTROL "&Kein Wrap-Around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,37,75,10
|
||||
@ -125,6 +126,7 @@ BEGIN
|
||||
CONTROL "Nur ganze &Wörter",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,78,110,10
|
||||
CONTROL "Nur Wort-&Anfänge",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,110,10
|
||||
CONTROL "&Transformiere Backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,90,10
|
||||
CONTROL "&Auto Esc Ctrl Zeichen", IDC_FINDAUTOESCCTRLCHR, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 125, 102, 85, 10
|
||||
CONTROL "&Regulärer &Ausdruck",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,114,96,10
|
||||
CONTROL "&Punkt ersetzt Alle",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,125,65,10
|
||||
CONTROL "&Kein Wrap-Around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,66,75,10
|
||||
|
||||
@ -91,6 +91,7 @@ BEGIN
|
||||
CONTROL "Match &whole word only",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,89,10
|
||||
CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,110,10
|
||||
CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,73,85,10
|
||||
CONTROL "&Auto Esc Ctrl Chr", IDC_FINDAUTOESCCTRLCHR, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 125, 73, 85, 10
|
||||
CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,96,10
|
||||
CONTROL "Dot &matches all",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,65,10
|
||||
CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,37,75,10
|
||||
@ -125,6 +126,7 @@ BEGIN
|
||||
CONTROL "Match &whole word only",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,78,89,10
|
||||
CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,110,10
|
||||
CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,89,10
|
||||
CONTROL "&Auto Esc Ctrl Chr", IDC_FINDAUTOESCCTRLCHR, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 125, 102, 85, 10
|
||||
CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,114,97,10
|
||||
CONTROL "Dot &matches all",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,125,65,10
|
||||
CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,66,75,10
|
||||
|
||||
@ -91,6 +91,7 @@ BEGIN
|
||||
CONTROL "Match &whole word only",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,49,89,10
|
||||
CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,110,10
|
||||
CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,73,85,10
|
||||
CONTROL "&Auto Esc Ctrl Chr", IDC_FINDAUTOESCCTRLCHR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,73,85,10
|
||||
CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,96,10
|
||||
CONTROL "Dot &matches all",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,65,10
|
||||
CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,37,75,10
|
||||
@ -125,6 +126,7 @@ BEGIN
|
||||
CONTROL "Match &whole word only",IDC_FINDWORD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,78,89,10
|
||||
CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,110,10
|
||||
CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,89,10
|
||||
CONTROL "&Auto Esc Ctrl Chr", IDC_FINDAUTOESCCTRLCHR, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 125, 73, 85, 10
|
||||
CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,114,97,10
|
||||
CONTROL "Dot &matches all",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,125,65,10
|
||||
CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,66,75,10
|
||||
|
||||
@ -907,14 +907,14 @@ void LoadSettings()
|
||||
Settings.EFR_Data.bNoFindWrap = IniSectionGetBool(IniSecSettings, L"NoFindWrap", Defaults.EFR_Data.bNoFindWrap);
|
||||
Defaults.EFR_Data.bTransformBS = false;
|
||||
Settings.EFR_Data.bTransformBS = IniSectionGetBool(IniSecSettings, L"FindTransformBS", Defaults.EFR_Data.bTransformBS);
|
||||
Defaults.EFR_Data.bAutoEscCtrlChars = false;
|
||||
Settings.EFR_Data.bAutoEscCtrlChars = IniSectionGetBool(IniSecSettings, L"AutoEscCtrlChars", Defaults.EFR_Data.bAutoEscCtrlChars);
|
||||
Defaults.EFR_Data.bWildcardSearch = false;
|
||||
Settings.EFR_Data.bWildcardSearch = IniSectionGetBool(IniSecSettings, L"WildcardSearch", Defaults.EFR_Data.bWildcardSearch);
|
||||
Defaults.EFR_Data.bMarkOccurences = true;
|
||||
Settings.EFR_Data.bMarkOccurences = IniSectionGetBool(IniSecSettings, L"FindMarkAllOccurrences", Defaults.EFR_Data.bMarkOccurences);
|
||||
Defaults.EFR_Data.bHideNonMatchedLines = false;
|
||||
Settings.EFR_Data.bHideNonMatchedLines = IniSectionGetBool(IniSecSettings, L"HideNonMatchedLines", Defaults.EFR_Data.bHideNonMatchedLines);
|
||||
Defaults.EFR_Data.bDotMatchAll = false;
|
||||
Settings.EFR_Data.bDotMatchAll = IniSectionGetBool(IniSecSettings, L"RegexDotMatchesAll", Defaults.EFR_Data.bDotMatchAll);
|
||||
Defaults.EFR_Data.fuFlags = 0;
|
||||
Settings.EFR_Data.fuFlags = (UINT)IniSectionGetInt(IniSecSettings, L"efrData_fuFlags", (int)Defaults.EFR_Data.fuFlags);
|
||||
|
||||
@ -1322,6 +1322,12 @@ static bool _SaveSettings(bool bForceSaveSettings)
|
||||
else {
|
||||
IniSectionDelete(IniSecSettings, L"FindTransformBS", false);
|
||||
}
|
||||
if (Settings.EFR_Data.bAutoEscCtrlChars != Defaults.EFR_Data.bAutoEscCtrlChars) {
|
||||
IniSectionSetBool(IniSecSettings, L"AutoEscCtrlChars", Settings.EFR_Data.bAutoEscCtrlChars);
|
||||
}
|
||||
else {
|
||||
IniSectionDelete(IniSecSettings, L"AutoEscCtrlChars", false);
|
||||
}
|
||||
if (Settings.EFR_Data.bWildcardSearch != Defaults.EFR_Data.bWildcardSearch) {
|
||||
IniSectionSetBool(IniSecSettings, L"WildcardSearch", Settings.EFR_Data.bWildcardSearch);
|
||||
}
|
||||
@ -1340,12 +1346,6 @@ static bool _SaveSettings(bool bForceSaveSettings)
|
||||
else {
|
||||
IniSectionDelete(IniSecSettings, L"HideNonMatchedLines", false);
|
||||
}
|
||||
if (Settings.EFR_Data.bDotMatchAll != Defaults.EFR_Data.bDotMatchAll) {
|
||||
IniSectionSetBool(IniSecSettings, L"RegexDotMatchesAll", Settings.EFR_Data.bDotMatchAll);
|
||||
}
|
||||
else {
|
||||
IniSectionDelete(IniSecSettings, L"RegexDotMatchesAll", false);
|
||||
}
|
||||
if (Settings.EFR_Data.fuFlags != Defaults.EFR_Data.fuFlags) {
|
||||
IniSectionSetInt(IniSecSettings, L"efrData_fuFlags", Settings.EFR_Data.fuFlags);
|
||||
}
|
||||
|
||||
355
src/Edit.c
355
src/Edit.c
@ -47,9 +47,6 @@
|
||||
#define LCMAP_TITLECASE 0x00000300 // Title Case Letters bit mask
|
||||
#endif
|
||||
|
||||
// find free bits in scintilla.h SCFIND_ defines
|
||||
#define SCFIND_NP3_REGEX (SCFIND_REGEXP | SCFIND_POSIX)
|
||||
|
||||
static EDITFINDREPLACE s_efrSave;
|
||||
static bool s_bSwitchedFindReplace = false;
|
||||
|
||||
@ -4975,33 +4972,31 @@ static void _SetSearchFlags(HWND hwnd, LPEDITFINDREPLACE lpefr)
|
||||
}
|
||||
}
|
||||
|
||||
bIsFlagSet = ((lpefr->fuFlags & SCFIND_NP3_REGEX) != 0);
|
||||
bIsFlagSet = ((lpefr->fuFlags & SCFIND_REGEXP) != 0);
|
||||
if (IsButtonChecked(hwnd, IDC_FINDREGEXP)) {
|
||||
if (!bIsFlagSet) {
|
||||
lpefr->fuFlags |= SCFIND_NP3_REGEX;
|
||||
lpefr->fuFlags |= SCFIND_REGEXP;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bIsFlagSet) {
|
||||
lpefr->fuFlags &= ~(SCFIND_NP3_REGEX);
|
||||
lpefr->fuFlags &= ~SCFIND_REGEXP;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
if (bIsFlagSet) // check "dot match all" too
|
||||
{
|
||||
bIsFlagSet = ((lpefr->fuFlags & SCFIND_DOT_MATCH_ALL) != 0);
|
||||
if (IsButtonChecked(hwnd, IDC_DOT_MATCH_ALL)) {
|
||||
if (!bIsFlagSet) {
|
||||
lpefr->fuFlags |= SCFIND_DOT_MATCH_ALL;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
|
||||
bIsFlagSet = ((lpefr->fuFlags & SCFIND_DOT_MATCH_ALL) != 0);
|
||||
if (IsButtonChecked(hwnd, IDC_DOT_MATCH_ALL)) {
|
||||
if (!bIsFlagSet) {
|
||||
lpefr->fuFlags |= SCFIND_DOT_MATCH_ALL;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
else {
|
||||
if (bIsFlagSet) {
|
||||
lpefr->fuFlags &= ~(SCFIND_DOT_MATCH_ALL);
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bIsFlagSet) {
|
||||
lpefr->fuFlags &= ~SCFIND_DOT_MATCH_ALL;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5018,20 +5013,6 @@ static void _SetSearchFlags(HWND hwnd, LPEDITFINDREPLACE lpefr)
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
if (bIsFlagSet) // special setting for wildcardsearch
|
||||
{
|
||||
bIsFlagSet = ((lpefr->fuFlags & SCFIND_NP3_REGEX) != 0);
|
||||
if (!bIsFlagSet) {
|
||||
lpefr->fuFlags |= SCFIND_NP3_REGEX;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
|
||||
bIsFlagSet = ((lpefr->fuFlags & SCFIND_DOT_MATCH_ALL) != 0);
|
||||
if (bIsFlagSet) {
|
||||
lpefr->fuFlags &= ~(SCFIND_DOT_MATCH_ALL);
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
bIsFlagSet = lpefr->bNoFindWrap;
|
||||
if (IsButtonChecked(hwnd, IDC_NOWRAP)) {
|
||||
@ -5075,6 +5056,20 @@ static void _SetSearchFlags(HWND hwnd, LPEDITFINDREPLACE lpefr)
|
||||
}
|
||||
}
|
||||
|
||||
bIsFlagSet = lpefr->bAutoEscCtrlChars;
|
||||
if (IsButtonChecked(hwnd, IDC_FINDAUTOESCCTRLCHR)) {
|
||||
if (!bIsFlagSet) {
|
||||
lpefr->bAutoEscCtrlChars = true;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (bIsFlagSet) {
|
||||
lpefr->bAutoEscCtrlChars = false;
|
||||
lpefr->bStateChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (bIsFindDlg)
|
||||
{
|
||||
bIsFlagSet = lpefr->bFindClose;
|
||||
@ -5120,7 +5115,7 @@ static void _EscapeWildcards(char* szFind2, LPCEDITFINDREPLACE lpefr)
|
||||
int iSource = 0;
|
||||
int iDest = 0;
|
||||
|
||||
lpefr->fuFlags |= SCFIND_NP3_REGEX;
|
||||
lpefr->fuFlags |= SCFIND_REGEXP;
|
||||
|
||||
while (szFind2[iSource] != '\0')
|
||||
{
|
||||
@ -5177,7 +5172,7 @@ static int _EditGetFindStrg(HWND hwnd, LPCEDITFINDREPLACE lpefr, LPSTR szFind,
|
||||
}
|
||||
if (!StringCchLenA(szFind, cchCnt)) { return 0; }
|
||||
|
||||
bool bIsRegEx = (lpefr->fuFlags & SCFIND_REGEXP);
|
||||
bool const bIsRegEx = (lpefr->fuFlags & SCFIND_REGEXP);
|
||||
if (lpefr->bTransformBS || bIsRegEx) {
|
||||
TransformBackslashes(szFind, bIsRegEx, Encoding_SciCP, NULL);
|
||||
}
|
||||
@ -5319,6 +5314,7 @@ static WCHAR s_tchBuf[FNDRPL_BUFFER] = { L'\0' }; // tmp working buffer
|
||||
static bool s_SaveMarkOccurrences = false;
|
||||
static bool s_SaveMarkMatchVisible = false;
|
||||
static bool s_SaveTFBackSlashes = false;
|
||||
static bool s_SaveAutoEscCtrlChars = false;
|
||||
static char s_lastFind[FNDRPL_BUFFER] = { L'\0' };
|
||||
|
||||
//=============================================================================
|
||||
@ -5328,35 +5324,37 @@ static char s_lastFind[FNDRPL_BUFFER] = { L'\0' };
|
||||
static LRESULT CALLBACK EditBoxForPasteFixes(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||
UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
|
||||
{
|
||||
UNUSED(dwRefData);
|
||||
LPEDITFINDREPLACE pefrData = (LPEDITFINDREPLACE)dwRefData;
|
||||
|
||||
switch (uMsg)
|
||||
if (pefrData)
|
||||
{
|
||||
case WM_PASTE:
|
||||
{
|
||||
EditGetClipboardW(s_tchBuf, COUNTOF(s_tchBuf));
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_PASTE:
|
||||
{
|
||||
EditGetClipboardW(s_tchBuf, COUNTOF(s_tchBuf));
|
||||
|
||||
if (s_SaveTFBackSlashes) {
|
||||
WCHAR tchBuf2[FNDRPL_BUFFER] = { L'\0' };
|
||||
SlashW(tchBuf2, COUNTOF(tchBuf2), s_tchBuf);
|
||||
SendMessage(hwnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)tchBuf2);
|
||||
if (pefrData->bAutoEscCtrlChars) {
|
||||
WCHAR tchBuf2[FNDRPL_BUFFER] = { L'\0' };
|
||||
SlashW(tchBuf2, COUNTOF(tchBuf2), s_tchBuf);
|
||||
SendMessage(hwnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)tchBuf2);
|
||||
}
|
||||
else {
|
||||
SendMessage(hwnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)s_tchBuf);
|
||||
}
|
||||
}
|
||||
else {
|
||||
UnSlashW(s_tchBuf);
|
||||
SendMessage(hwnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)s_tchBuf);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
|
||||
//case WM_LBUTTONDOWN:
|
||||
// SendMessage(hwnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)L"X");
|
||||
// return TRUE;
|
||||
//case WM_LBUTTONDOWN:
|
||||
// SendMessage(hwnd, EM_REPLACESEL, (WPARAM)TRUE, (LPARAM)L"X");
|
||||
// return TRUE;
|
||||
|
||||
case WM_NCDESTROY:
|
||||
RemoveWindowSubclass(hwnd, EditBoxForPasteFixes, uIdSubclass);
|
||||
// fall through
|
||||
default:
|
||||
break;
|
||||
case WM_NCDESTROY:
|
||||
RemoveWindowSubclass(hwnd, EditBoxForPasteFixes, uIdSubclass);
|
||||
// fall through
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return DefSubclassProc(hwnd, uMsg, wParam, lParam);
|
||||
}
|
||||
@ -5422,10 +5420,13 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
SendDlgItemMessage(hwnd, IDC_FINDTEXT, CB_LIMITTEXT, FNDRPL_BUFFER, 0);
|
||||
SendDlgItemMessage(hwnd, IDC_FINDTEXT, CB_SETEXTENDEDUI, true, 0);
|
||||
|
||||
// before searchboxes are filled
|
||||
CheckDlgButton(hwnd, IDC_FINDAUTOESCCTRLCHR, SetBtn(sg_pefrData->bAutoEscCtrlChars));
|
||||
|
||||
COMBOBOXINFO infoF = { sizeof(COMBOBOXINFO) };
|
||||
GetComboBoxInfo(GetDlgItem(hwnd, IDC_FINDTEXT), &infoF);
|
||||
if (infoF.hwndItem) {
|
||||
SetWindowSubclass(infoF.hwndItem, EditBoxForPasteFixes, 0, 0);
|
||||
SetWindowSubclass(infoF.hwndItem, EditBoxForPasteFixes, 0, (DWORD_PTR)sg_pefrData);
|
||||
SHAutoComplete(infoF.hwndItem, SHACF_FILESYS_ONLY | SHACF_AUTOAPPEND_FORCE_OFF | SHACF_AUTOSUGGEST_FORCE_OFF);
|
||||
}
|
||||
|
||||
@ -5445,75 +5446,76 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
SetDlgItemTextMB2W(hwnd, IDC_REPLACETEXT, sg_pefrData->szReplace);
|
||||
}
|
||||
|
||||
if (sg_pefrData->fuFlags & SCFIND_MATCHCASE)
|
||||
CheckDlgButton(hwnd, IDC_FINDCASE, BST_CHECKED);
|
||||
|
||||
if (sg_pefrData->fuFlags & SCFIND_WHOLEWORD)
|
||||
CheckDlgButton(hwnd, IDC_FINDWORD, BST_CHECKED);
|
||||
|
||||
if (sg_pefrData->fuFlags & SCFIND_WORDSTART)
|
||||
CheckDlgButton(hwnd, IDC_FINDSTART, BST_CHECKED);
|
||||
|
||||
if (sg_pefrData->bTransformBS) {
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_CHECKED);
|
||||
}
|
||||
bool const bRegEx = (sg_pefrData->fuFlags & SCFIND_REGEXP) != 0;
|
||||
bool const bDotMatchAll = (sg_pefrData->fuFlags & SCFIND_DOT_MATCH_ALL) != 0;
|
||||
s_SaveTFBackSlashes = sg_pefrData->bTransformBS;
|
||||
|
||||
if (sg_pefrData->fuFlags & SCFIND_REGEXP) {
|
||||
CheckDlgButton(hwnd, IDC_FINDREGEXP, BST_CHECKED);
|
||||
CheckDlgButton(hwnd, IDC_WILDCARDSEARCH, BST_UNCHECKED);
|
||||
DialogEnableControl(hwnd, IDC_DOT_MATCH_ALL, true);
|
||||
if (sg_pefrData->bTransformBS || bRegEx) {
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_CHECKED);
|
||||
}
|
||||
|
||||
if (sg_pefrData->bDotMatchAll) {
|
||||
if (bDotMatchAll) {
|
||||
CheckDlgButton(hwnd, IDC_DOT_MATCH_ALL, BST_CHECKED);
|
||||
}
|
||||
|
||||
if (sg_pefrData->bWildcardSearch) {
|
||||
CheckDlgButton(hwnd, IDC_FINDREGEXP, BST_UNCHECKED);
|
||||
CheckDlgButton(hwnd, IDC_WILDCARDSEARCH, BST_CHECKED);
|
||||
DialogEnableControl(hwnd, IDC_DOT_MATCH_ALL, false);
|
||||
}
|
||||
|
||||
if (sg_pefrData->bMarkOccurences) {
|
||||
CheckDlgButton(hwnd, IDC_ALL_OCCURRENCES, BST_CHECKED);
|
||||
}
|
||||
else {
|
||||
CheckDlgButton(hwnd, IDC_ALL_OCCURRENCES, BST_UNCHECKED);
|
||||
EditClearAllOccurrenceMarkers(sg_pefrData->hwnd);
|
||||
Globals.iMarkOccurrencesCount = (DocPos)-1;
|
||||
}
|
||||
|
||||
if (sg_pefrData->fuFlags & SCFIND_REGEXP) {
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_CHECKED);
|
||||
if (bRegEx) {
|
||||
CheckDlgButton(hwnd, IDC_FINDREGEXP, BST_CHECKED);
|
||||
sg_pefrData->bWildcardSearch = false;
|
||||
DialogEnableControl(hwnd, IDC_FINDTRANSFORMBS, false);
|
||||
}
|
||||
else {
|
||||
DialogEnableControl(hwnd, IDC_DOT_MATCH_ALL, false);
|
||||
}
|
||||
|
||||
if (sg_pefrData->bWildcardSearch) {
|
||||
CheckDlgButton(hwnd, IDC_WILDCARDSEARCH, BST_CHECKED);
|
||||
CheckDlgButton(hwnd, IDC_FINDREGEXP, BST_UNCHECKED);
|
||||
DialogEnableControl(hwnd, IDC_DOT_MATCH_ALL, false);
|
||||
// transform BS handled by regex (wildcard search based on):
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_CHECKED);
|
||||
DialogEnableControl(hwnd, IDC_FINDTRANSFORMBS, false);
|
||||
}
|
||||
|
||||
if (sg_pefrData->bMarkOccurences) {
|
||||
CheckDlgButton(hwnd, IDC_ALL_OCCURRENCES, BST_CHECKED);
|
||||
} else {
|
||||
EditClearAllOccurrenceMarkers(sg_pefrData->hwnd);
|
||||
Globals.iMarkOccurrencesCount = (DocPos)-1;
|
||||
}
|
||||
|
||||
if (sg_pefrData->fuFlags & SCFIND_MATCHCASE) {
|
||||
CheckDlgButton(hwnd, IDC_FINDCASE, BST_CHECKED);
|
||||
}
|
||||
if (sg_pefrData->fuFlags & SCFIND_WHOLEWORD) {
|
||||
CheckDlgButton(hwnd, IDC_FINDWORD, BST_CHECKED);
|
||||
}
|
||||
if (sg_pefrData->fuFlags & SCFIND_WORDSTART) {
|
||||
CheckDlgButton(hwnd, IDC_FINDSTART, BST_CHECKED);
|
||||
}
|
||||
if (sg_pefrData->bNoFindWrap) {
|
||||
CheckDlgButton(hwnd, IDC_NOWRAP, BST_CHECKED);
|
||||
}
|
||||
|
||||
if (GetDlgItem(hwnd, IDC_REPLACE)) {
|
||||
if (s_bSwitchedFindReplace) {
|
||||
if (sg_pefrData->bFindClose)
|
||||
if (sg_pefrData->bFindClose) {
|
||||
CheckDlgButton(hwnd, IDC_FINDCLOSE, BST_CHECKED);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (sg_pefrData->bReplaceClose)
|
||||
if (sg_pefrData->bReplaceClose) {
|
||||
CheckDlgButton(hwnd, IDC_FINDCLOSE, BST_CHECKED);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (s_bSwitchedFindReplace) {
|
||||
if (sg_pefrData->bReplaceClose)
|
||||
if (sg_pefrData->bReplaceClose) {
|
||||
CheckDlgButton(hwnd, IDC_FINDCLOSE, BST_CHECKED);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (sg_pefrData->bFindClose)
|
||||
if (sg_pefrData->bFindClose) {
|
||||
CheckDlgButton(hwnd, IDC_FINDCLOSE, BST_CHECKED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5566,68 +5568,70 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
_SetSearchFlags(hwnd, sg_pefrData); // sync
|
||||
|
||||
if (!s_bSwitchedFindReplace)
|
||||
{
|
||||
if (!s_bSwitchedFindReplace)
|
||||
{
|
||||
if (s_anyMatch == MATCH) {
|
||||
// Save MRUs
|
||||
if (StringCchLenA(sg_pefrData->szFind, COUNTOF(sg_pefrData->szFind))) {
|
||||
if (GetDlgItemText(hwnd, IDC_FINDTEXT, s_tchBuf, COUNTOF(s_tchBuf))) {
|
||||
MRU_Add(Globals.pMRUfind, s_tchBuf, 0, -1, -1, NULL);
|
||||
SetFindPattern(s_tchBuf);
|
||||
}
|
||||
if (s_anyMatch == MATCH) {
|
||||
// Save MRUs
|
||||
if (StringCchLenA(sg_pefrData->szFind, COUNTOF(sg_pefrData->szFind))) {
|
||||
if (GetDlgItemText(hwnd, IDC_FINDTEXT, s_tchBuf, COUNTOF(s_tchBuf))) {
|
||||
MRU_Add(Globals.pMRUfind, s_tchBuf, 0, -1, -1, NULL);
|
||||
SetFindPattern(s_tchBuf);
|
||||
}
|
||||
}
|
||||
sg_pefrData->szFind[0] = '\0';
|
||||
}
|
||||
sg_pefrData->szFind[0] = '\0';
|
||||
|
||||
Globals.iReplacedOccurrences = 0;
|
||||
Globals.FindReplaceMatchFoundState = FND_NOP;
|
||||
Globals.iReplacedOccurrences = 0;
|
||||
Globals.FindReplaceMatchFoundState = FND_NOP;
|
||||
|
||||
Settings.MarkOccurrences = s_SaveMarkOccurrences;
|
||||
Settings.MarkOccurrencesMatchVisible = s_SaveMarkMatchVisible;
|
||||
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, true);
|
||||
Settings.MarkOccurrences = s_SaveMarkOccurrences;
|
||||
Settings.MarkOccurrencesMatchVisible = s_SaveMarkMatchVisible;
|
||||
EnableCmd(GetMenu(Globals.hwndMain), IDM_VIEW_MARKOCCUR_ONOFF, true);
|
||||
|
||||
if (FocusedView.HideNonMatchedLines) {
|
||||
EditToggleView(sg_pefrData->hwnd);
|
||||
}
|
||||
if (FocusedView.HideNonMatchedLines) {
|
||||
EditToggleView(sg_pefrData->hwnd);
|
||||
}
|
||||
|
||||
if (IsMarkOccurrencesEnabled()) {
|
||||
MarkAllOccurrences(50, true);
|
||||
if (IsMarkOccurrencesEnabled()) {
|
||||
MarkAllOccurrences(50, true);
|
||||
}
|
||||
else {
|
||||
EditClearAllOccurrenceMarkers(sg_pefrData->hwnd);
|
||||
Globals.iMarkOccurrencesCount = (DocPos)-1;
|
||||
}
|
||||
|
||||
if (s_InitialTopLine >= 0) {
|
||||
SciCall_SetFirstVisibleLine(s_InitialTopLine);
|
||||
s_InitialTopLine = -1; // reset
|
||||
}
|
||||
else {
|
||||
if (s_fwrdMatch == NO_MATCH) {
|
||||
EditSetSelectionEx(sg_pefrData->hwnd, s_InitialAnchorPos, s_InitialCaretPos, -1, -1);
|
||||
}
|
||||
else {
|
||||
EditClearAllOccurrenceMarkers(sg_pefrData->hwnd);
|
||||
Globals.iMarkOccurrencesCount = (DocPos)-1;
|
||||
}
|
||||
|
||||
if (s_InitialTopLine >= 0) {
|
||||
SciCall_SetFirstVisibleLine(s_InitialTopLine);
|
||||
s_InitialTopLine = -1; // reset
|
||||
}
|
||||
else {
|
||||
if (s_fwrdMatch == NO_MATCH) {
|
||||
EditSetSelectionEx(sg_pefrData->hwnd, s_InitialAnchorPos, s_InitialCaretPos, -1, -1);
|
||||
}
|
||||
else {
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
}
|
||||
|
||||
CmdMessageQueue_t* pmqc = NULL;
|
||||
CmdMessageQueue_t* dummy;
|
||||
DL_FOREACH_SAFE(MessageQueue, pmqc, dummy)
|
||||
{
|
||||
DL_DELETE(MessageQueue, pmqc);
|
||||
FreeMem(pmqc);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
}
|
||||
|
||||
KillTimer(hwnd, IDT_TIMER_MRKALL);
|
||||
DeleteObject(hBrushRed);
|
||||
DeleteObject(hBrushGreen);
|
||||
DeleteObject(hBrushBlue);
|
||||
ResizeDlg_Destroy(hwnd, &Settings.FindReplaceDlgSizeX, NULL);
|
||||
CmdMessageQueue_t* pmqc = NULL;
|
||||
CmdMessageQueue_t* dummy;
|
||||
DL_FOREACH_SAFE(MessageQueue, pmqc, dummy)
|
||||
{
|
||||
DL_DELETE(MessageQueue, pmqc);
|
||||
FreeMem(pmqc);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
KillTimer(hwnd, IDT_TIMER_MRKALL);
|
||||
DeleteObject(hBrushRed);
|
||||
DeleteObject(hBrushGreen);
|
||||
DeleteObject(hBrushBlue);
|
||||
ResizeDlg_Destroy(hwnd, &Settings.FindReplaceDlgSizeX, NULL);
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
case WM_SIZE: {
|
||||
@ -5661,9 +5665,11 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
|
||||
case WM_ACTIVATE:
|
||||
{
|
||||
if (!sg_pefrData) { return false; }
|
||||
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case WA_INACTIVE:
|
||||
SetWindowTransparentMode(hwnd, Settings.FindReplaceTransparentMode, Settings2.FindReplaceOpacityLevel);
|
||||
break;
|
||||
@ -5695,9 +5701,9 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
case WM_COMMAND:
|
||||
@ -5727,7 +5733,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
DocPos const cchSelection = SciCall_GetSelText(NULL);
|
||||
if ((1 < cchSelection) && (LOWORD(wParam) != IDC_REPLACETEXT)) {
|
||||
lpszSelection = AllocMem(cchSelection, HEAP_ZERO_MEMORY);
|
||||
if (s_SaveTFBackSlashes) {
|
||||
if (sg_pefrData->bAutoEscCtrlChars) {
|
||||
char* buf = AllocMem(cchSelection, HEAP_ZERO_MEMORY);
|
||||
if (buf) {
|
||||
SciCall_GetSelText(buf);
|
||||
@ -5754,12 +5760,11 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
size_t const len = StringCchLenA(pClip, 0);
|
||||
if (len) {
|
||||
lpszSelection = AllocMem(len + 1, HEAP_ZERO_MEMORY);
|
||||
if (s_SaveTFBackSlashes) {
|
||||
if (sg_pefrData->bAutoEscCtrlChars) {
|
||||
SlashA(lpszSelection, len + 1, pClip);
|
||||
}
|
||||
else {
|
||||
StringCchCopyA(lpszSelection, len + 1, pClip);
|
||||
UnSlashA(lpszSelection, Encoding_SciCP);
|
||||
}
|
||||
}
|
||||
FreeMem(pClip);
|
||||
@ -5828,7 +5833,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
break;
|
||||
|
||||
case IDT_TIMER_MAIN_MRKALL:
|
||||
if (!sg_pefrData) { return false; }
|
||||
if (sg_pefrData->bMarkOccurences) {
|
||||
if (sg_pefrData->bStateChanged || (StringCchCompareXA(s_lastFind, sg_pefrData->szFind) != 0)) {
|
||||
_IGNORE_NOTIFY_CHANGE_;
|
||||
@ -5875,8 +5879,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
case IDC_ALL_OCCURRENCES:
|
||||
{
|
||||
if (!sg_pefrData) { break; }
|
||||
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
|
||||
if (IsButtonChecked(hwnd, IDC_ALL_OCCURRENCES))
|
||||
@ -5898,7 +5900,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
|
||||
case IDC_TOGGLE_VISIBILITY:
|
||||
if (!sg_pefrData) { break; }
|
||||
EditToggleView(sg_pefrData->hwnd);
|
||||
if (!FocusedView.HideNonMatchedLines) {
|
||||
if (sg_pefrData) {
|
||||
@ -5912,7 +5913,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
|
||||
case IDC_FINDREGEXP:
|
||||
if (!sg_pefrData) { break; }
|
||||
if (IsButtonChecked(hwnd, IDC_FINDREGEXP))
|
||||
{
|
||||
DialogEnableControl(hwnd, IDC_DOT_MATCH_ALL, true);
|
||||
@ -5930,24 +5930,23 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
break;
|
||||
|
||||
case IDC_DOT_MATCH_ALL:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_WILDCARDSEARCH:
|
||||
if (!sg_pefrData) { break; }
|
||||
if (IsButtonChecked(hwnd, IDC_WILDCARDSEARCH))
|
||||
{
|
||||
CheckDlgButton(hwnd, IDC_FINDREGEXP, BST_UNCHECKED);
|
||||
DialogEnableControl(hwnd, IDC_DOT_MATCH_ALL, false);
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, SetBtn(s_SaveTFBackSlashes));
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_CHECKED); // transform BS handled by regex
|
||||
// transform BS handled by regex (wildcard search based on):
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_CHECKED);
|
||||
DialogEnableControl(hwnd, IDC_FINDTRANSFORMBS, false);
|
||||
}
|
||||
else { // unchecked
|
||||
DialogEnableControl(hwnd, IDC_FINDTRANSFORMBS, true);
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, SetBtn(s_SaveTFBackSlashes));
|
||||
DialogEnableControl(hwnd, IDC_FINDTRANSFORMBS, true);
|
||||
}
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
@ -5955,9 +5954,16 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
case IDC_FINDTRANSFORMBS:
|
||||
{
|
||||
if (!sg_pefrData) { break; }
|
||||
s_SaveTFBackSlashes = IsButtonChecked(hwnd, IDC_FINDTRANSFORMBS);
|
||||
if (s_SaveTFBackSlashes) {
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_FINDAUTOESCCTRLCHR:
|
||||
{
|
||||
s_SaveAutoEscCtrlChars = IsButtonChecked(hwnd, IDC_FINDAUTOESCCTRLCHR);
|
||||
if (s_SaveAutoEscCtrlChars) {
|
||||
char buf[FNDRPL_BUFFER + 1];
|
||||
SlashA(buf, COUNTOF(buf), sg_pefrData->szFind);
|
||||
StringCchCopyA(sg_pefrData->szFind, COUNTOF(sg_pefrData->szFind), buf);
|
||||
@ -5982,19 +5988,16 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
break;
|
||||
|
||||
case IDC_FINDCASE:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_FINDWORD:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_FINDSTART:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
@ -6014,8 +6017,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
case IDMSG_SWITCHTOFIND:
|
||||
case IDMSG_SWITCHTOREPLACE:
|
||||
{
|
||||
if (!sg_pefrData) { break; }
|
||||
|
||||
bool bIsFindDlg = (GetDlgItem(Globals.hwndDlgFindReplace, IDC_REPLACE) == NULL);
|
||||
|
||||
if ((bIsFindDlg && LOWORD(wParam) == IDMSG_SWITCHTOREPLACE) ||
|
||||
@ -6140,7 +6141,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
case IDC_SWAPSTRG:
|
||||
{
|
||||
if (!sg_pefrData) { break; }
|
||||
WCHAR* wszFind = s_tchBuf;
|
||||
WCHAR wszRepl[FNDRPL_BUFFER] = { L'\0' };
|
||||
GetDlgItemTextW(hwnd, IDC_FINDTEXT, wszFind, COUNTOF(wszFind));
|
||||
@ -6194,6 +6194,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
CheckDlgButton(hwnd, IDC_DOT_MATCH_ALL, BST_UNCHECKED);
|
||||
CheckDlgButton(hwnd, IDC_WILDCARDSEARCH, BST_UNCHECKED);
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, BST_UNCHECKED);
|
||||
CheckDlgButton(hwnd, IDC_FINDAUTOESCCTRLCHR, BST_UNCHECKED);
|
||||
PostMessage(hwnd, WM_NEXTDLGCTL, (WPARAM)(GetDlgItem(hwnd, IDC_FINDTEXT)), 1);
|
||||
break;
|
||||
|
||||
@ -6606,7 +6607,7 @@ static char* _GetReplaceString(HWND hwnd, LPCEDITFINDREPLACE lpefr, int* iRepla
|
||||
size_t const size = StringCchLenA(lpefr->szReplace,0) + 1;
|
||||
pszReplace = (char*)AllocMem(size, HEAP_ZERO_MEMORY);
|
||||
StringCchCopyA(pszReplace, size, lpefr->szReplace);
|
||||
bool bIsRegEx = (lpefr->fuFlags & SCFIND_REGEXP);
|
||||
bool const bIsRegEx = (lpefr->fuFlags & SCFIND_REGEXP);
|
||||
if (lpefr->bTransformBS || bIsRegEx) {
|
||||
TransformBackslashes(pszReplace, bIsRegEx, Encoding_SciCP, iReplaceMsg);
|
||||
}
|
||||
@ -6938,9 +6939,9 @@ void EditSelectWordAtPos(const DocPos iPos, const bool bForceWord)
|
||||
//
|
||||
int EditAddSearchFlags(int flags, bool bRegEx, bool bWordStart, bool bMatchCase, bool bMatchWords, bool bDotMatchAll)
|
||||
{
|
||||
flags |= (bRegEx) ? SCFIND_REGEXP : 0;
|
||||
flags |= (bWordStart) ? SCFIND_WORDSTART : 0;
|
||||
flags |= (bMatchWords) ? SCFIND_WHOLEWORD : 0;
|
||||
flags |= (bRegEx ? SCFIND_REGEXP : 0);
|
||||
flags |= (bWordStart ? SCFIND_WORDSTART : 0);
|
||||
flags |= (bMatchWords ? SCFIND_WHOLEWORD : 0);
|
||||
flags |= (bMatchCase ? SCFIND_MATCHCASE : 0);
|
||||
flags |= (bDotMatchAll ? SCFIND_DOT_MATCH_ALL : 0);
|
||||
return flags;
|
||||
@ -7334,7 +7335,7 @@ static void _UpdateIndicators(HWND hwnd, const int indicator, const int indicato
|
||||
|
||||
DocPos const _start = start;
|
||||
DocPos const _end = end;
|
||||
DocPos const iPos = _FindInTarget(hwnd, regExpr, iRegExLen, SCFIND_NP3_REGEX, &start, &end, false, FRMOD_IGNORE);
|
||||
DocPos const iPos = _FindInTarget(hwnd, regExpr, iRegExLen, SCFIND_REGEXP, &start, &end, false, FRMOD_IGNORE);
|
||||
|
||||
if (iPos < 0) {
|
||||
// not found
|
||||
|
||||
@ -5967,7 +5967,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
EDITFINDREPLACE efrTS = EFR_INIT_DATA;
|
||||
efrTS.hwnd = Globals.hwndEdit;
|
||||
efrTS.fuFlags = SCFIND_REGEXP;
|
||||
efrTS.fuFlags = (SCFIND_REGEXP | SCFIND_POSIX);
|
||||
|
||||
StringCchCopyW(wchFind, COUNTOF(wchFind), Settings2.TimeStamp);
|
||||
|
||||
|
||||
@ -269,6 +269,10 @@ BEGIN
|
||||
"Z", IDM_EDIT_UNDO, VIRTKEY, CONTROL, NOINVERT
|
||||
"Z", IDM_EDIT_STRIP1STCHAR, VIRTKEY, ALT, NOINVERT /// NO Menu
|
||||
"Z", IDM_EDIT_REDO, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
//VK_END, CMD_VKEND, VIRTKEY, NOINVERT
|
||||
//VK_HOME, CMD_VKEND, VIRTKEY, NOINVERT
|
||||
//VK_PRIOR, CMD_VKEND, VIRTKEY, NOINVERT /// PAGE UP Key
|
||||
//VK_NEXT, CMD_VKEND, VIRTKEY, NOINVERT /// PAGE NEXT Key
|
||||
//~VK_LEFT, CMD_LEFT, VIRTKEY, NOINVERT
|
||||
VK_LEFT, CMD_CTRLLEFT, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_LEFT, CMD_ALTLEFT, VIRTKEY, ALT, NOINVERT
|
||||
@ -286,6 +290,9 @@ BEGIN
|
||||
VK_DELETE, CMD_CTRLDEL, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_DELETE, IDM_EDIT_CUT, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_DELETE, IDM_EDIT_DELETELINERIGHT, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
VK_UP, CMD_ALTUP, VIRTKEY, ALT, NOINVERT
|
||||
VK_UP, CMD_CTRLUP, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_UP, IDM_EDIT_MOVELINEUP, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
VK_DOWN, CMD_ALTDOWN, VIRTKEY, ALT, NOINVERT
|
||||
VK_DOWN, CMD_CTRLDOWN, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_DOWN, IDM_EDIT_MOVELINEDOWN, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
@ -293,16 +300,6 @@ BEGIN
|
||||
VK_ESCAPE, CMD_SHIFTESC, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F1, IDM_HELP_ONLINEDOCUMENTATION, VIRTKEY, NOINVERT
|
||||
VK_F1, IDM_HELP_ABOUT, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F10, CMD_RECODEGB18030, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
VK_F11, CMD_FULLSCRWINPOS, VIRTKEY, NOINVERT
|
||||
VK_F11, CMD_INITIALWINPOS, VIRTKEY, CONTROL, NOINVERT
|
||||
//~VK_F11, CMD_LEXHTML, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_F11, CMD_LEXDEFAULT, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F12, IDM_VIEW_SCHEME, VIRTKEY, NOINVERT
|
||||
VK_F12, IDM_VIEW_SCHEMECONFIG, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_F12, IDM_VIEW_FONT, VIRTKEY, ALT, NOINVERT
|
||||
VK_F12, IDM_VIEW_USE2NDDEFAULT, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F12, IDM_VIEW_CURRENTSCHEME, VIRTKEY, CONTROL, ALT, NOINVERT
|
||||
VK_F2, IDM_EDIT_SELTONEXT, VIRTKEY, CONTROL, ALT, NOINVERT
|
||||
VK_F2, IDM_EDIT_SELTOPREV, VIRTKEY, SHIFT, CONTROL, ALT, NOINVERT
|
||||
VK_F2, BME_EDIT_BOOKMARKNEXT, VIRTKEY, NOINVERT
|
||||
@ -337,10 +334,21 @@ BEGIN
|
||||
VK_F9, IDM_FILE_MANAGEFAV, VIRTKEY, ALT, NOINVERT
|
||||
VK_F9, CMD_COPYPATHNAME, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F9, IDM_EDIT_INSERT_PATHNAME, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
VK_F10, CMD_RECODEGB18030, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
VK_F11, CMD_FULLSCRWINPOS, VIRTKEY, NOINVERT
|
||||
VK_F11, CMD_INITIALWINPOS, VIRTKEY, CONTROL, NOINVERT
|
||||
//~VK_F11, CMD_LEXHTML, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_F11, CMD_LEXDEFAULT, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F12, IDM_VIEW_SCHEME, VIRTKEY, NOINVERT
|
||||
VK_F12, IDM_VIEW_SCHEMECONFIG, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_F12, IDM_VIEW_FONT, VIRTKEY, ALT, NOINVERT
|
||||
VK_F12, IDM_VIEW_USE2NDDEFAULT, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_F12, IDM_VIEW_CURRENTSCHEME, VIRTKEY, CONTROL, ALT, NOINVERT
|
||||
VK_OEM_2, IDM_EDIT_LINECOMMENT, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_OEM_2, IDM_EDIT_STREAMCOMMENT, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
VK_DIVIDE, IDM_EDIT_LINECOMMENT, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_DIVIDE, IDM_EDIT_STREAMCOMMENT, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
//VK_MULTIPLY, CMD_VK_MULTIPLY, VIRTKEY, NOINVERT
|
||||
VK_NUMPAD0, IDM_VIEW_RESETZOOM, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_OEM_COMMA, CMD_JUMP2SELSTART, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_OEM_MINUS, IDM_VIEW_ZOOMOUT, VIRTKEY, CONTROL, NOINVERT
|
||||
@ -360,9 +368,6 @@ BEGIN
|
||||
VK_TAB, CMD_TAB, VIRTKEY, NOINVERT
|
||||
VK_TAB, CMD_BACKTAB, VIRTKEY, SHIFT, NOINVERT
|
||||
VK_TAB, CMD_CTRLTAB, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_UP, CMD_ALTUP, VIRTKEY, ALT, NOINVERT
|
||||
VK_UP, CMD_CTRLUP, VIRTKEY, CONTROL, NOINVERT
|
||||
VK_UP, IDM_EDIT_MOVELINEUP, VIRTKEY, SHIFT, CONTROL, NOINVERT
|
||||
VK_INSERT, CMD_VK_INSERT, VIRTKEY, NOINVERT
|
||||
END
|
||||
|
||||
|
||||
@ -192,13 +192,13 @@ typedef struct _editfindreplace
|
||||
char szReplace[FNDRPL_BUFFER];
|
||||
UINT fuFlags;
|
||||
bool bTransformBS;
|
||||
bool bAutoEscCtrlChars;
|
||||
bool bFindClose;
|
||||
bool bReplaceClose;
|
||||
bool bNoFindWrap;
|
||||
bool bWildcardSearch;
|
||||
bool bMarkOccurences;
|
||||
bool bHideNonMatchedLines;
|
||||
bool bDotMatchAll;
|
||||
bool bStateChanged;
|
||||
HWND hwnd;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user