From: Kornel Benko Date: Tue, 29 Mar 2022 16:00:13 +0000 (+0200) Subject: FindAdv: Amend 23fe87bf: X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6888c2670640e17808df6ab0a0a1c9112715c248;p=features.git FindAdv: Amend 23fe87bf: Write one line of code and produce 10 new errors :( --- diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 62be62e500..53da1dbec9 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1094,7 +1094,7 @@ static string latexNamesToUtf8(docstring strIn) string addtmp = to_utf8(strIn); static regex const rmAcc("(\\\\)*(" "\\\\([A-Za-z]+\\{.\\})" // e.g. "ddot{A}" == sub.str(3) - "|\\\\([A-Za-z]+)( |\\{\\})?" // e.g. "LyX", "LyX{}", "LyX " == sub.str(5) + "|\\\\([A-Za-z]+)( |\\{\\})?" // e.g. "LyX", "LyX{}", "LyX " == sub.str(4) ")" ); size_t lastpos = 0; @@ -1113,7 +1113,7 @@ static string latexNamesToUtf8(docstring strIn) if (sub.length(3) > 0) key = sub.str(3); else - key = sub.str(5); + key = sub.str(4); AccentsIterator it_ac = accents.find(key); if (it_ac == accents.end()) { replace = sub.str(2); @@ -1129,6 +1129,8 @@ static string latexNamesToUtf8(docstring strIn) } if (lastpos == 0) add = addtmp; + else + add += addtmp.substr(lastpos, addtmp.length() - lastpos); LYXERR(Debug::FIND, "Adding to search string: '" << add << "'"); return add;