commit b702eda4ed7ee1c492b0ad24f3c1bd0434d14fde
Author: Kornel Benko <[email protected]>
Date: Mon Mar 4 14:37:10 2019 +0100
FindAdv: Amend cd4ae51f
Prevent to match only part of a macro.
For instance, we want find '\imath' but not '\imathxxxx'
while checking for accents.
---
src/lyxfind.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index eeb4829..83d99a1 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;