From dc48cee5f7f4efe1f70e7269fe5e46ac8b861b1b Mon Sep 17 00:00:00 2001 From: Ale Date: Wed, 20 Nov 2019 08:59:43 +0000 Subject: [PATCH] Add find in files filter excluding ability Filter usage example: *.* !*.exe !*.obj !*.log Close #7618, close #7626 --- PowerEditor/src/MISC/Common/Common.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index a5c85127e..ebce1b306 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -973,12 +973,21 @@ bool str2Clipboard(const generic_string &str2cpy, HWND hwnd) bool matchInList(const TCHAR *fileName, const std::vector & patterns) { + bool is_matched = false; for (size_t i = 0, len = patterns.size(); i < len; ++i) { + if (patterns[i].length() > 1 && patterns[i][0] == '!') + { + if (PathMatchSpec(fileName, patterns[i].c_str() + 1)) + return false; + + continue; + } + if (PathMatchSpec(fileName, patterns[i].c_str())) - return true; + is_matched = true; } - return false; + return is_matched; } generic_string GetLastErrorAsString(DWORD errorCode)