Jürgen,

your patch looks nice in general. I can imagine that it even fixes #3160. Below 
please find some additional comments.

Michael

Index: src/lyxfind.cpp
===================================================================
--- src/lyxfind.cpp     (Revision 18711)
+++ src/lyxfind.cpp     (Arbeitskopie)
@@ -101,20 +101,26 @@
 };
-bool findForward(DocIterator & cur, MatchString const & match)
+bool findForward(DocIterator & cur, MatchString const & match,
+                bool find_del = true)
 {
        for (; cur; cur.forwardChar())
-               if (cur.inTexted() && match(cur.paragraph(), cur.pos()))
+               if (cur.inTexted() &&
+                   (find_del || !cur.paragraph().isDeleted(cur.pos())) &&
+                   match(cur.paragraph(), cur.pos()))
                        return true;
        return false;
 }


AFAICS, you only check the deletion status of the first character. However, ALL matching characters shouldn't be marked as deleted.
-bool findBackwards(DocIterator & cur, MatchString const & match)
+bool findBackwards(DocIterator & cur, MatchString const & match,
+                bool find_del = true)
 {
        while (cur) {
                cur.backwardChar();
-               if (cur.inTexted() && match(cur.paragraph(), cur.pos()))
+               if (cur.inTexted() &&
+                   (find_del || !cur.paragraph().isDeleted(cur.pos())) &&
+                   match(cur.paragraph(), cur.pos()))
                        return true;
        }
        return false;

The same here. Maybe we should propagate find_del to match(...).

+       case LFUN_WORD_REPLACE:
+               flag.enabled(!cur.paragraph().isDeleted(cur.pos()));
+               break;
+

... and here (but I am willing to accept this minor bug) ...


*** The End ***

Reply via email to