]> git.lyx.org Git - features.git/commitdiff
Amend f8071449: Added conversion for unicode 0x2bb
authorKornel Benko <kornel@lyx.org>
Tue, 15 Mar 2022 12:01:51 +0000 (13:01 +0100)
committerKornel Benko <kornel@lyx.org>
Tue, 15 Mar 2022 12:01:51 +0000 (13:01 +0100)
Now regex using \textquoteleft works also without format search.

src/lyxfind.cpp

index 6308c64de8f4696f0a6ca0f783a8e71e756c1823..bb678f802ef8961a4510c4534174a8c0b9d85eb0 100644 (file)
@@ -830,16 +830,21 @@ string string2regex(string in)
        return temp2;
 }
 
+static void buildAccentsMap();
+
 string correctRegex(string t, bool withformat)
 {
        /* Convert \backslash => \
         * and \{, \}, \[, \] => {, }, [, ]
         */
        string s("");
-       regex wordre("(\\\\)*(\\\\((backslash|mathcircumflex) ?|[\\[\\]\\{\\}]))");
+       regex wordre("(\\\\)*(\\\\((backslash|mathcircumflex|textquoteleft) ?|[\\[\\]\\{\\}]))");
        size_t lastpos = 0;
        smatch sub;
        bool backslashed = false;
+       if (accents.empty())
+               buildAccentsMap();
+
        for (sregex_iterator it(t.begin(), t.end(), wordre), end; it != end; ++it) {
                sub = *it;
                string replace;
@@ -861,6 +866,8 @@ string correctRegex(string t, bool withformat)
                        }
                        else if (sub.str(4) == "mathcircumflex")
                                replace = "^";
+                       else if (sub.str(4) == "textquoteleft")
+                               replace = accents["textquoteleft"];
                        else if (backslashed) {
                                backslashed = false;
                                if (withformat && (sub.str(3) == "{"))