]> git.lyx.org Git - lyx.git/commitdiff
Ignore tracked deletions in simple find (#11051)
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 12 Jan 2021 15:11:58 +0000 (16:11 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 12 Jan 2021 15:11:58 +0000 (16:11 +0100)
src/Paragraph.cpp
src/lyxfind.cpp

index 1b6a766fb54f6a7d289bc7eeb443260ff0f25c7f..8181b1c4b6a34c34a6233350ef739e8bca657f8d 100644 (file)
@@ -4388,6 +4388,13 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
        int i = 0;
        pos_type const parsize = d->text_.size();
        for (i = 0; i < strsize && pos < parsize; ++i, ++pos) {
+               // ignore deleted matter
+               if (!del && isDeleted(pos)) {
+                       if (pos == parsize - 1)
+                               break;
+                       pos++;
+                       continue;
+               }
                // Ignore "invisible" letters such as ligature breaks
                // and hyphenation chars while searching
                while (pos < parsize - 1 && isInset(pos)) {
@@ -4404,8 +4411,6 @@ int Paragraph::find(docstring const & str, bool cs, bool mw,
                        break;
                if (!cs && uppercase(str[i]) != uppercase(d->text_[pos]))
                        break;
-               if (!del && isDeleted(pos))
-                       break;
        }
 
        if (i != strsize)
index abbabf9a3491270bb7d712e178ceda210813c13f..677b382b8453a3e880ee84188305703371bb5a6f 100644 (file)
@@ -464,7 +464,7 @@ bool lyxfind(BufferView * bv, FuncRequest const & ev)
        bool matchword     = parse_bool(howto);
        bool forward       = parse_bool(howto);
 
-       return findOne(bv, search, casesensitive, matchword, forward, true, true);
+       return findOne(bv, search, casesensitive, matchword, forward, false, true);
 }