commit 6888c2670640e17808df6ab0a0a1c9112715c248
Author: Kornel Benko <[email protected]>
Date:   Tue Mar 29 18:00:13 2022 +0200

    FindAdv: Amend 23fe87bf:
    
    Write one line of code and produce 10 new errors :(
---
 src/lyxfind.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 62be62e..53da1db 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;
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to