[LyX/master] Amend 3736bee4: Forgot to set the cassensitivity flag in regex statement

Kornel Benko kornel at lyx.org
Sun Dec 27 11:17:30 UTC 2020


commit c7bc46d707b3c790be50f55353a4bd929789fe62
Author: Kornel Benko <kornel at lyx.org>
Date:   Sun Dec 27 12:16:37 2020 +0100

    Amend 3736bee4: Forgot to set the cassensitivity flag in regex statement
---
 src/lyxfind.cpp |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index a9988f9..e7f345b 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -2884,10 +2884,15 @@ MatchStringAdv::MatchStringAdv(lyx::Buffer & buf, FindAndReplaceOptions const &
 			regexp2_str = "(" + lead_as_regexp + ").*?" + par_as_string;
 		}
 		LYXERR(Debug::FIND, "Setting regexp to : '" << regexp_str << "'");
-		regexp = regex(regexp_str);
-
 		LYXERR(Debug::FIND, "Setting regexp2 to: '" << regexp2_str << "'");
-		regexp2 = regex(regexp2_str);
+		if (! opt.casesensitive) {
+			regexp = regex(regexp_str, std::regex_constants::icase);
+			regexp2 = regex(regexp2_str, std::regex_constants::icase);
+		}
+		else {
+			regexp = regex(regexp_str);
+			regexp2 = regex(regexp2_str);
+		}
 	}
 }
 


More information about the lyx-cvs mailing list