commit 22efd5a5efc4ef53bcf9fc65ccd4d372b7365ac6
Author: Juergen Spitzmueller <[email protected]>
Date:   Wed Jan 13 08:19:54 2021 +0100

    Simple Search: find isChar() insets (#11462)
---
 src/Paragraph.cpp |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 994098d..d954e1e 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -4397,21 +4397,26 @@ int Paragraph::find(docstring const & str, bool cs, 
bool mw,
                }
                // 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()) {
                                int const insetstringsize = os.str().length();
                                for (int j = 0; j < insetstringsize && pos < 
parsize; ++i, ++j) {
-                                       if (str[i] != os.str()[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]))
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to