]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
FindAdv: Amend ec387b6d: Handle search for '{' and '}'
[lyx.git] / src / Paragraph.cpp
index d954e1e5a52beef55af6c83fdf422a96af495750..8a634a6b0c9d4fcbaf0293f90156e460988149ba 100644 (file)
@@ -1132,8 +1132,16 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
        if (style.pass_thru || runparams.pass_thru || runparams.for_search
            || contains(style.pass_thru_chars, c)
            || contains(runparams.pass_thru_chars, c)) {
-               if ((c == '\\') && runparams.for_search)
-                       os << "\\\\";
+               if (runparams.for_search) {
+                       if (c == '\\')
+                               os << "\\\\";
+                       else if (c == '{')
+                               os << "\\braceleft";
+                       else if (c == '}')
+                               os << "\\braceright";
+                       else if (c != '\0')
+                               os.put(c);
+               }
                else if (c != '\0') {
                        Encoding const * const enc = runparams.encoding;
                        if (enc && !enc->encodable(c))
@@ -4393,6 +4401,7 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
                        if (pos == parsize - 1)
                                break;
                        pos++;
+                       --i;
                        continue;
                }
                // Ignore "invisible" letters such as ligature breaks