From: Kornel Benko Date: Mon, 4 Mar 2019 13:37:10 +0000 (+0100) Subject: FindAdv: Amend cd4ae51f X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5feeab26e676c9e2d7c3d885181c4f22b78b8059;p=features.git FindAdv: Amend cd4ae51f Prevent to match only part of a macro. For instance, we want find '\imath' but not '\imathxxxx' while checking for accents. --- diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index eeb4829510..83d99a10e4 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1329,7 +1329,7 @@ void Intervall::removeAccents() { if (accents.empty()) buildAccentsMap(); - static regex const accre("\\\\((.|grave|breve|u|lyxmathsym|ddot|dot|acute|dacute|mathring|check|hat|bar|tilde)\\{[^\\{\\}]+\\}|i|imath|jmath)"); + static regex const accre("\\\\((.|grave|breve|lyxmathsym|ddot|dot|acute|dacute|mathring|check|hat|bar|tilde)\\{[^\\{\\}]+\\}|(i|imath|jmath)(?![a-zA-Z]))"); smatch sub; for (sregex_iterator itacc(par.begin(), par.end(), accre), end; itacc != end; ++itacc) { sub = *itacc;