mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-17 21:03:19 +08:00
Merge pull request #3725 from RaiKoHoff/Dev_LongPath
Update: grepWinNP3 & Oniguruma
This commit is contained in:
commit
08a40cfef3
@ -509,16 +509,16 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Import Project="..\packages\boost.1.76.0.0\build\boost.targets" Condition="Exists('..\packages\boost.1.76.0.0\build\boost.targets')" />
|
||||
<Import Project="..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets" Condition="Exists('..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets')" />
|
||||
<Import Project="..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets" Condition="Exists('..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets')" />
|
||||
<Import Project="..\packages\boost.1.77.0.0\build\boost.targets" Condition="Exists('..\packages\boost.1.77.0.0\build\boost.targets')" />
|
||||
<Import Project="..\packages\boost_iostreams-vc142.1.77.0.0\build\boost_iostreams-vc142.targets" Condition="Exists('..\packages\boost_iostreams-vc142.1.77.0.0\build\boost_iostreams-vc142.targets')" />
|
||||
<Import Project="..\packages\boost_regex-vc142.1.77.0.0\build\boost_regex-vc142.targets" Condition="Exists('..\packages\boost_regex-vc142.1.77.0.0\build\boost_regex-vc142.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\boost.1.76.0.0\build\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost.1.76.0.0\build\boost.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost.1.77.0.0\build\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost.1.77.0.0\build\boost.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_iostreams-vc142.1.77.0.0\build\boost_iostreams-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_iostreams-vc142.1.77.0.0\build\boost_iostreams-vc142.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_regex-vc142.1.77.0.0\build\boost_regex-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_regex-vc142.1.77.0.0\build\boost_regex-vc142.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="boost" version="1.76.0.0" targetFramework="native" />
|
||||
<package id="boost_iostreams-vc142" version="1.76.0.0" targetFramework="native" />
|
||||
<package id="boost_regex-vc142" version="1.76.0.0" targetFramework="native" />
|
||||
<package id="boost" version="1.77.0.0" targetFramework="native" />
|
||||
<package id="boost_iostreams-vc142" version="1.77.0.0" targetFramework="native" />
|
||||
<package id="boost_regex-vc142" version="1.77.0.0" targetFramework="native" />
|
||||
</packages>
|
||||
@ -110,6 +110,8 @@ CSearchDlg::CSearchDlg(HWND hParent)
|
||||
//, m_dwThreadRunning(FALSE)
|
||||
//, m_cancelled(FALSE)
|
||||
, m_bookmarksDlg(nullptr)
|
||||
, m_patternRegexC(false)
|
||||
, m_excludeDirsPatternRegexC(false)
|
||||
, m_bUseRegex(false)
|
||||
, m_bUseRegexForPaths(false)
|
||||
, m_bAllSize(false)
|
||||
@ -289,7 +291,7 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
}
|
||||
}
|
||||
|
||||
if (m_patternRegex.empty())
|
||||
if (m_patternRegex.empty() && !m_patternRegexC)
|
||||
{
|
||||
if (bPortable)
|
||||
{
|
||||
@ -302,7 +304,7 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
m_bUseRegexForPaths = !!static_cast<DWORD>(m_regUseRegexForPaths);
|
||||
}
|
||||
}
|
||||
if (m_excludeDirsPatternRegex.empty())
|
||||
if (m_excludeDirsPatternRegex.empty() && !m_excludeDirsPatternRegexC)
|
||||
{
|
||||
if (bPortable)
|
||||
m_excludeDirsPatternRegex = g_iniFile.GetValue(L"global", L"ExcludeDirsPattern", L"");
|
||||
@ -767,7 +769,7 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
|
||||
break;
|
||||
case WM_SETCURSOR:
|
||||
{
|
||||
if (IsEvaluationThreadRunning())
|
||||
if (IsEvaluationThreadRunning() && LOWORD(lParam) == 1)
|
||||
{
|
||||
SetCursor(LoadCursor(nullptr, IDC_APPSTARTING));
|
||||
return TRUE;
|
||||
@ -3437,12 +3439,6 @@ void CSearchDlg::SetSearchPath(const std::wstring& path)
|
||||
SearchReplace(m_searchPath, L"/", L"\\");
|
||||
}
|
||||
|
||||
void CSearchDlg::SetFileMask(const std::wstring& mask, bool reg)
|
||||
{
|
||||
m_patternRegex = mask;
|
||||
m_bUseRegexForPaths = reg;
|
||||
}
|
||||
|
||||
void CSearchDlg::SetPreset(const std::wstring& preset)
|
||||
{
|
||||
CBookmarks bookmarks;
|
||||
@ -3481,16 +3477,18 @@ void CSearchDlg::SetPreset(const std::wstring& preset)
|
||||
if (!bk.Path.empty())
|
||||
m_searchPath = bk.Path;
|
||||
|
||||
m_bIncludeSystemC = true;
|
||||
m_bIncludeHiddenC = true;
|
||||
m_bIncludeSubfoldersC = true;
|
||||
m_bIncludeBinaryC = true;
|
||||
m_bCreateBackupC = true;
|
||||
m_bCreateBackupInFoldersC = true;
|
||||
m_bWholeWordsC = true;
|
||||
m_bUTF8C = true;
|
||||
m_bCaseSensitiveC = true;
|
||||
m_bDotMatchesNewlineC = true;
|
||||
m_bIncludeSystemC = true;
|
||||
m_bIncludeHiddenC = true;
|
||||
m_bIncludeSubfoldersC = true;
|
||||
m_bIncludeBinaryC = true;
|
||||
m_bCreateBackupC = true;
|
||||
m_bCreateBackupInFoldersC = true;
|
||||
m_bWholeWordsC = true;
|
||||
m_bUTF8C = true;
|
||||
m_bCaseSensitiveC = true;
|
||||
m_bDotMatchesNewlineC = true;
|
||||
m_patternRegexC = true;
|
||||
m_excludeDirsPatternRegexC = true;
|
||||
|
||||
removeQuotes(m_searchString);
|
||||
removeQuotes(m_replaceString);
|
||||
|
||||
@ -96,11 +96,11 @@ public:
|
||||
DWORD EvaluationThread();
|
||||
|
||||
void SetSearchPath(const std::wstring& path);
|
||||
void SetFileMask(const std::wstring& mask, bool reg);
|
||||
void SetPreset(const std::wstring& preset);
|
||||
|
||||
inline void SetSearchString(const std::wstring& search) { m_searchString = search; }
|
||||
inline void SetDirExcludeRegexMask(const std::wstring& mask) { m_excludeDirsPatternRegex = mask; }
|
||||
inline void SetFileMask(const std::wstring& mask, bool reg) { m_patternRegex = mask; m_bUseRegexForPaths = reg; m_patternRegexC = true; };
|
||||
inline void SetDirExcludeRegexMask(const std::wstring& mask) { m_excludeDirsPatternRegex = mask; m_excludeDirsPatternRegexC = true; }
|
||||
inline void SetReplaceWith(const std::wstring& replace) { m_replaceString = replace; }
|
||||
inline void SetUseRegex(bool reg) { m_bUseRegex = reg; }
|
||||
|
||||
@ -184,7 +184,9 @@ private:
|
||||
std::wstring m_replaceString;
|
||||
std::vector<std::wstring> m_patterns;
|
||||
std::wstring m_patternRegex;
|
||||
bool m_patternRegexC;
|
||||
std::wstring m_excludeDirsPatternRegex;
|
||||
bool m_excludeDirsPatternRegexC;
|
||||
bool m_bUseRegex;
|
||||
bool m_bUseRegexForPaths;
|
||||
bool m_bAllSize;
|
||||
|
||||
@ -428,28 +428,26 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
||||
searchDlg.SetDateLimit(_wtoi(searchIni.GetValue(section.c_str(), L"datelimit")), date1, date2);
|
||||
}
|
||||
}
|
||||
std::wstring spath = parser.HasVal(L"searchpath") ? parser.GetVal(L"searchpath") :
|
||||
(bPortable ? g_iniFile.GetValue(L"global", L"searchpath", L"") : L"");
|
||||
if (!spath.empty()) {
|
||||
SearchReplace(spath, L"/", L"\\");
|
||||
spath = SanitizeSearchPaths(spath);
|
||||
searchDlg.SetSearchPath(spath);
|
||||
if (parser.HasKey(L"searchpath"))
|
||||
{
|
||||
std::wstring sPath = parser.HasVal(L"searchpath") ? parser.GetVal(L"searchpath") :
|
||||
(bPortable ? g_iniFile.GetValue(L"global", L"searchpath", L"") : L"");
|
||||
sPath = SanitizeSearchPaths(sPath);
|
||||
searchDlg.SetSearchPath(sPath);
|
||||
}
|
||||
std::wstring searchfor = parser.HasVal(L"searchfor") ? parser.GetVal(L"searchfor") :
|
||||
(bPortable ? g_iniFile.GetValue(L"global", L"searchfor", L"") : L"");
|
||||
if (!spath.empty()) {
|
||||
searchDlg.SetSearchString(searchfor);
|
||||
}
|
||||
if (parser.HasVal(L"filemaskregex"))
|
||||
searchDlg.SetFileMask(parser.GetVal(L"filemaskregex"), true);
|
||||
if (parser.HasVal(L"filemask"))
|
||||
searchDlg.SetFileMask(parser.GetVal(L"filemask"), false);
|
||||
if (parser.HasVal(L"direxcluderegex"))
|
||||
searchDlg.SetDirExcludeRegexMask(parser.GetVal(L"direxcluderegex"));
|
||||
else if (parser.HasVal(L"filemaskexclude"))
|
||||
searchDlg.SetDirExcludeRegexMask(parser.GetVal(L"filemaskexclude"));
|
||||
if (parser.HasVal(L"replacewith"))
|
||||
searchDlg.SetReplaceWith(parser.GetVal(L"replacewith"));
|
||||
if (parser.HasKey(L"searchfor"))
|
||||
searchDlg.SetSearchString(parser.GetVal(L"searchfor") ? parser.GetVal(L"searchfor") :
|
||||
(bPortable ? g_iniFile.GetValue(L"global", L"searchfor", L"") : L""));
|
||||
if (parser.HasKey(L"filemaskregex"))
|
||||
searchDlg.SetFileMask(parser.GetVal(L"filemaskregex") ? parser.GetVal(L"filemaskregex") : L"", true);
|
||||
if (parser.HasKey(L"filemask"))
|
||||
searchDlg.SetFileMask(parser.GetVal(L"filemask") ? parser.GetVal(L"filemask") : L"", false);
|
||||
if (parser.HasKey(L"direxcluderegex"))
|
||||
searchDlg.SetDirExcludeRegexMask(parser.GetVal(L"direxcluderegex") ? parser.GetVal(L"direxcluderegex") : L"");
|
||||
else if (parser.HasKey(L"filemaskexclude"))
|
||||
searchDlg.SetDirExcludeRegexMask(parser.GetVal(L"filemaskexclude") ? parser.GetVal(L"filemaskexclude") : L"");
|
||||
if (parser.HasKey(L"replacewith"))
|
||||
searchDlg.SetReplaceWith(parser.GetVal(L"replacewith") ? parser.GetVal(L"replacewith") : L"");
|
||||
if (parser.HasVal(L"preset"))
|
||||
searchDlg.SetPreset(parser.GetVal(L"preset"));
|
||||
|
||||
@ -523,7 +521,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
|
||||
searchDlg.SetDateLimit(parser.GetLongVal(L"datelimit"), date1, date2);
|
||||
}
|
||||
|
||||
if (!parser.HasVal(L"searchpath"))
|
||||
if (!parser.HasKey(L"searchpath"))
|
||||
{
|
||||
auto cmdLineSize = wcslen(lpCmdLine);
|
||||
auto cmdLinePath = std::make_unique<wchar_t[]>(cmdLineSize + 1);
|
||||
|
||||
@ -6,13 +6,13 @@
|
||||
|
||||
//#pragma message(__LOC__"Run the NAnt script to get proper version info")
|
||||
|
||||
#define FILEVER 2, 1, 8, 39
|
||||
#define PRODUCTVER 2, 1, 8, 39
|
||||
#define STRFILEVER "2.1.8.39\0"
|
||||
#define STRPRODUCTVER "2.1.8.39\0"
|
||||
#define FILEVER 2, 1, 8, 40
|
||||
#define PRODUCTVER 2, 1, 8, 40
|
||||
#define STRFILEVER "2.1.8.40\0"
|
||||
#define STRPRODUCTVER "2.1.8.40\0"
|
||||
|
||||
#define GREPWIN_VERMAJOR 2
|
||||
#define GREPWIN_VERMINOR 1
|
||||
#define GREPWIN_VERMICRO 8
|
||||
#define GREPWIN_VERBUILD 39
|
||||
#define GREPWIN_VERDATE "2021-07-26"
|
||||
#define GREPWIN_VERBUILD 40
|
||||
#define GREPWIN_VERDATE "2021-10-19"
|
||||
|
||||
@ -3249,27 +3249,34 @@ enum GetValue {
|
||||
GET_VALUE_FOUND = 1
|
||||
};
|
||||
|
||||
#define MAX_NEST_LEVEL_GET_TREE_TAIL_LITERAL 16
|
||||
|
||||
static int
|
||||
get_tree_tail_literal(Node* node, Node** rnode, regex_t* reg)
|
||||
get_tree_tail_literal(Node* node, Node** rnode, regex_t* reg, int nest_level)
|
||||
{
|
||||
int r;
|
||||
|
||||
nest_level++;
|
||||
if (nest_level >= MAX_NEST_LEVEL_GET_TREE_TAIL_LITERAL) {
|
||||
return GET_VALUE_NONE;
|
||||
}
|
||||
|
||||
switch (NODE_TYPE(node)) {
|
||||
case NODE_LIST:
|
||||
if (IS_NULL(NODE_CDR(node))) {
|
||||
r = get_tree_tail_literal(NODE_CAR(node), rnode, reg);
|
||||
r = get_tree_tail_literal(NODE_CAR(node), rnode, reg, nest_level);
|
||||
}
|
||||
else {
|
||||
r = get_tree_tail_literal(NODE_CDR(node), rnode, reg);
|
||||
r = get_tree_tail_literal(NODE_CDR(node), rnode, reg, nest_level);
|
||||
if (r == GET_VALUE_IGNORE) {
|
||||
r = get_tree_tail_literal(NODE_CAR(node), rnode, reg);
|
||||
r = get_tree_tail_literal(NODE_CAR(node), rnode, reg, nest_level);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef USE_CALL
|
||||
case NODE_CALL:
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg);
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg, nest_level);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@ -3307,7 +3314,7 @@ get_tree_tail_literal(Node* node, Node** rnode, regex_t* reg)
|
||||
{
|
||||
QuantNode* qn = QUANT_(node);
|
||||
if (qn->lower != 0) {
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg);
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg, nest_level);
|
||||
}
|
||||
else
|
||||
r = GET_VALUE_NONE;
|
||||
@ -3323,12 +3330,12 @@ get_tree_tail_literal(Node* node, Node** rnode, regex_t* reg)
|
||||
r = GET_VALUE_NONE;
|
||||
else {
|
||||
NODE_STATUS_ADD(node, MARK1);
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg);
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg, nest_level);
|
||||
NODE_STATUS_REMOVE(node, MARK1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg);
|
||||
r = get_tree_tail_literal(NODE_BODY(node), rnode, reg, nest_level);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -4585,7 +4592,7 @@ tune_look_behind(Node* node, regex_t* reg, int state, ParseEnv* env)
|
||||
if (IS_NULL(an->lead_node)) {
|
||||
an->char_min_len = ci.min;
|
||||
an->char_max_len = ci.max;
|
||||
r = get_tree_tail_literal(body, &tail, reg);
|
||||
r = get_tree_tail_literal(body, &tail, reg, 0);
|
||||
if (r == GET_VALUE_FOUND) {
|
||||
r = onig_node_copy(&(an->lead_node), tail);
|
||||
if (r != 0) return r;
|
||||
@ -8079,8 +8086,12 @@ onig_detect_can_be_slow_pattern(const UChar* pattern,
|
||||
if (count.max_empty_check_nest_level > 2)
|
||||
n += count.max_empty_check_nest_level - 2;
|
||||
|
||||
if (count.heavy_element != 0)
|
||||
n += count.heavy_element << 8;
|
||||
if (count.heavy_element != 0) {
|
||||
if (count.heavy_element < 0x10000)
|
||||
n += count.heavy_element << 8;
|
||||
else
|
||||
n += count.heavy_element;
|
||||
}
|
||||
|
||||
r = n;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user