if (bv->buffer().isReadonly())
return pair<bool, int>(false, 0);
- cap::replaceSelectionWithString(cur, replacestr, forward);
+ cap::replaceSelectionWithString(cur, replacestr);
if (forward) {
cur.pos() += replacestr.length();
LASSERT(cur.pos() <= cur.lastpos(), /* */);
{
if (!cur)
return 0;
- while (cur) {
+ while (!theApp()->longOperationCancelled() && cur) {
LYXERR(Debug::FIND, "findForwardAdv() cur: " << cur);
int match_len = match(cur, -1, false);
LYXERR(Debug::FIND, "match_len: " << match_len);
if (match_len) {
- for (; cur; cur.forwardPos()) {
+ for (; !theApp()->longOperationCancelled() && cur; cur.forwardPos()) {
LYXERR(Debug::FIND, "Advancing cur: " << cur);
int match_len = match(cur);
LYXERR(Debug::FIND, "match_len: " << match_len);
else
cur.backwardPos();
pit_changed = true;
- } while (true);
+ } while (!theApp()->longOperationCancelled());
return 0;
}