]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Keep dialog connected to cross-ref inset after Apply.
[lyx.git] / src / Paragraph.cpp
index 8181b1c4b6a34c34a6233350ef739e8bca657f8d..cc0a765791c8953321bb3ea6bd4d44095c66f0b4 100644 (file)
@@ -4393,20 +4393,31 @@ 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
                // and hyphenation chars while searching
-               while (pos < parsize - 1 && isInset(pos)) {
+               bool nonmatch = false;
+               while (pos < parsize && isInset(pos)) {
                        Inset const * inset = getInset(pos);
-                       if (!inset->isLetter())
+                       if (!inset->isLetter() && !inset->isChar())
                                break;
                        odocstringstream os;
                        inset->toString(os);
-                       if (!os.str().empty())
-                               break;
+                       if (!os.str().empty()) {
+                               int const insetstringsize = os.str().length();
+                               for (int j = 0; j < insetstringsize && pos < parsize; ++i, ++j) {
+                                       if (str[i] != os.str()[j]) {
+                                               nonmatch = true;
+                                               break;
+                                       }
+                               }
+                       }
                        pos++;
                }
+               if (nonmatch || i == strsize)
+                       break;
                if (cs && str[i] != d->text_[pos])
                        break;
                if (!cs && uppercase(str[i]) != uppercase(d->text_[pos]))