commit 9bef4f9f1a488bd3ee503d64ab6c8888fc774ea5
Author: Kornel Benko <[email protected]>
Date:   Tue Mar 15 13:01:51 2022 +0100

    Amend f8071449: Added conversion for unicode 0x2bb
    
    Now regex using \textquoteleft works also without format search.
---
 src/lyxfind.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index 6308c64..bb678f8 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -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) == "{"))
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to