#include "frontends/Alert.h"
#include "frontends/LyXView.h"
-#include "support/textutils.h"
#include "support/tostr.h"
-#include "support/std_sstream.h"
+#include <sstream>
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;
// if necessary, check whether string matches word
if (mw) {
- if (pos > 0 && IsLetterCharOrDigit(par.getChar(pos - 1)))
+ if (pos > 0 && par.isLetter(pos - 1))
return false;
if (pos + lyx::pos_type(size) < parsize
- && IsLetterCharOrDigit(par.getChar(pos + size)));
+ && par.isLetter(pos + size));
return false;
}
bool findBackwards(DocIterator & cur, MatchString const & match)
{
- for (; cur; cur.backwardChar())
+ while (cur) {
+ cur.backwardChar();
if (cur.inTexted() && match(cur.paragraph(), cur.pos()))
return true;
+ }
return false;
}
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;
return false;
Paragraph const & par = cur.paragraph();
- pos_type pos = cur.pos();
+ const pos_type pos = cur.pos();
Change orig_change = par.lookupChangeFull(pos);
- pos_type parsize = par.size();
+ const pos_type parsize = par.size();
pos_type end = pos;
for (; end != parsize; ++end) {
}
}
pos_type length = end - pos;
- bv->putSelectionAt(cur, length, true);
+ bv->putSelectionAt(cur, length, false);
+ // if we used a lfun like in find/replace, dispatch would do
+ // that for us
+ bv->update();
+ if (bv->fitCursor())
+ bv->update();
+
return true;
}
} // find namespace
} // lyx namespace
-
-