From: Juergen Spitzmueller Date: Wed, 13 Jan 2021 07:19:54 +0000 (+0100) Subject: Simple Search: find isChar() insets (#11462) X-Git-Tag: 2.4.0-alpha3~301 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=22efd5a5efc4ef53bcf9fc65ccd4d372b7365ac6;p=lyx.git Simple Search: find isChar() insets (#11462) --- diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 994098df48..d954e1e5a5 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]))