]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfind.C
* Replace all use of 'slashify_path' with 'internal_path'.
[lyx.git] / src / lyxfind.C
index 4509a1163b8a3f5440568578f92d8e0f34f4ac66..769aa2c44c6ec65ba5c2e943be3ad5076fa60872 100644 (file)
@@ -38,7 +38,7 @@ using lyx::support::lowercase;
 using lyx::support::uppercase;
 using lyx::support::split;
 
-using lyx::par_type;
+using lyx::pit_type;
 using lyx::pos_type;
 
 using std::advance;
@@ -85,10 +85,10 @@ public:
 
                // if necessary, check whether string matches word
                if (mw) {
-                       if (pos > 0 && par.isWord(pos - 1))
+                       if (pos > 0 && par.isLetter(pos - 1))
                                return false;
                        if (pos + lyx::pos_type(size) < parsize
-                           && par.isWord(pos + size));
+                           && par.isLetter(pos + size));
                                return false;
                }
 
@@ -128,7 +128,7 @@ bool findBackwards(DocIterator & cur, MatchString const & match)
 bool findChange(DocIterator & cur)
 {
        for (; cur; cur.forwardChar())
-               if (cur.inTexted() && !cur.paragraph().empty() &&
+               if (cur.inTexted() && cur.pos() != cur.paragraph().size() &&
                    cur.paragraph().lookupChange(cur.pos())
                    != Change::UNCHANGED)
                        return true;
@@ -218,7 +218,7 @@ bool stringSelected(BufferView * bv, string const & searchstr,
 
 
 int replace(BufferView * bv, string const & searchstr,
-      string const & replacestr, bool cs, bool mw, bool fw)
+           string const & replacestr, bool cs, bool mw, bool fw)
 {
        if (!searchAllowed(bv, searchstr) || bv->buffer()->isReadonly())
                return 0;
@@ -363,6 +363,9 @@ bool findNextChange(BufferView * bv)
        }
        pos_type length = end - pos;
        bv->putSelectionAt(cur, length, false);
+       // if we used a lfun like in find/replace, dispatch would do
+       // that for us
+       bv->update();
 
        return true;
 }