diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index f78cefb974..b4a33fad04 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -3343,10 +3343,13 @@ int Paragraph::find(docstring const & str, bool cs, bool mw, int const strsize = str.length(); int i = 0; pos_type const parsize = d->text_.size(); + odocstringstream os; for (i = 0; i < strsize && pos < parsize; ++i, ++pos) { - // Ignore ligature break and hyphenation chars while searching + // Ignore "invisible" letters such as ligature breaks + // and hyphenation chars while searching while (pos < parsize - 1 && isInset(pos)) { - if (!getInset(pos)->skipOnSearch()) + getInset(pos)->toString(os); + if (!getInset(pos)->isLetter() || !os.str().empty()) break; pos++; } diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 7b2c04c627..3b3e4306d3 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -402,9 +402,6 @@ public: /// Is the content of this inset part of the output document? virtual bool producesOutput() const { return true; } - /// Skip this inset while searching? - virtual bool skipOnSearch() const { return false; } - /// \return Tool tip for this inset. /// This default implementation returns an empty string. virtual docstring toolTip(BufferView const & bv, int x, int y) const; diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index 6550ac9094..106755076b 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -346,12 +346,6 @@ bool InsetSpecialChar::isLetter() const } -bool InsetSpecialChar::skipOnSearch() const -{ - return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK; -} - - bool InsetSpecialChar::isLineSeparator() const { #if 0 diff --git a/src/insets/InsetSpecialChar.h b/src/insets/InsetSpecialChar.h index b96863a732..70741ec787 100644 --- a/src/insets/InsetSpecialChar.h +++ b/src/insets/InsetSpecialChar.h @@ -77,13 +77,11 @@ public: /// void validate(LaTeXFeatures &) const; - // should this inset be handled like a normal charater + /// should this inset be handled like a normal charater bool isChar() const { return true; } /// is this equivalent to a letter? bool isLetter() const; - /// Skip this inset while searching? - bool skipOnSearch() const; - // should we break lines after this inset? + /// should we break lines after this inset? bool isLineSeparator() const; private: Inset * clone() const { return new InsetSpecialChar(*this); };