Skip to content

Commit cd377f0

Browse files
committed
Clear regex flags for /m match text command option, issue #965.
1 parent 0589943 commit cd377f0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Notepad4.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,11 @@ static void HandleMatchText(MatchTextFlag flag, LPCWSTR lpszText, bool jumpTo) n
702702

703703
if (flag & MatchTextFlag_Regex) {
704704
efrData.fuFlags |= (iFindReplaceOption & FindReplaceOption_UseCxxRegex) ? (SCFIND_REGEXP | SCFIND_CXX11REGEX) : (SCFIND_REGEXP | SCFIND_POSIX);
705-
} else if (flag & MatchTextFlag_TransformBS) {
706-
efrData.option |= FindReplaceOption_TransformBackslash;
705+
} else {
706+
efrData.fuFlags &= SCFIND_REGEXP - 1; // clear all regex flags
707+
if (flag & MatchTextFlag_TransformBS) {
708+
efrData.option |= FindReplaceOption_TransformBackslash;
709+
}
707710
}
708711

709712
if (flag & MatchTextFlag_FindUp) {

0 commit comments

Comments
 (0)