summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
75d1099)
Allows for matches inside style Uncover if used
Settings->Adhere to search string formatting
This does not cover all of #12594 though.
}
else {
if (sub.str(4) == "backslash") {
}
else {
if (sub.str(4) == "backslash") {
+ replace = string("\\");
{
// transforms '\backslash \{' into '\{'
string next = t.substr(sub.position(2) + sub.str(2).length(), 2);
{
// transforms '\backslash \{' into '\{'
string next = t.substr(sub.position(2) + sub.str(2).length(), 2);
DocIterator orig_cur; // to be used if repeat not successful
MatchResult orig_mres;
DocIterator orig_cur; // to be used if repeat not successful
MatchResult orig_mres;
+ do {
+ orig_cur = cur;
+ cur.forwardPos();
+ } while (cur.depth() > orig_cur.depth());
+ cur = orig_cur;
while (!theApp()->longOperationCancelled() && cur) {
//(void) findAdvForwardInnermost(cur);
LYXERR(Debug::FINDVERBOSE, "findForwardAdv() cur: " << cur);
MatchResult mres = match(cur, -1, MatchStringAdv::MatchAnyPlace);
string msg = "Starting";
while (!theApp()->longOperationCancelled() && cur) {
//(void) findAdvForwardInnermost(cur);
LYXERR(Debug::FINDVERBOSE, "findForwardAdv() cur: " << cur);
MatchResult mres = match(cur, -1, MatchStringAdv::MatchAnyPlace);
string msg = "Starting";
msg = "Repeated";
displayMres(mres, msg + " findForwardAdv", cur)
int match_len = mres.match_len;
msg = "Repeated";
displayMres(mres, msg + " findForwardAdv", cur)
int match_len = mres.match_len;
match_len = 0;
}
if (match_len <= 0) {
match_len = 0;
}
if (match_len <= 0) {
- // This should exit nested insets, if any, or otherwise undefine the currsor.
- cur.pos() = cur.lastpos();
+ if (repeat > 0) {
+ repeat--;
+ }
+ else {
+ // This should exit nested insets, if any, or otherwise undefine the currsor.
+ cur.pos() = cur.lastpos();
+ }
LYXERR(Debug::FINDVERBOSE, "Advancing pos: cur=" << cur);
cur.forwardPos();
}
LYXERR(Debug::FINDVERBOSE, "Advancing pos: cur=" << cur);
cur.forwardPos();
}
cur.pos() = cur.pos() + increment;
MatchResult mres2 = match(cur, -1, MatchStringAdv::MatchAnyPlace);
displayMres(mres2, "findForwardAdv loop", cur)
cur.pos() = cur.pos() + increment;
MatchResult mres2 = match(cur, -1, MatchStringAdv::MatchAnyPlace);
displayMres(mres2, "findForwardAdv loop", cur)
- switch (interpretMatch(mres, mres2)) {
+ switch (interpretMatch(mres, mres2)) {
case MatchResult::newIsTooFar:
// behind the expected match
firstInvalid = increment;
case MatchResult::newIsTooFar:
// behind the expected match
firstInvalid = increment;
increment /= 2;
break;
case MatchResult::newIsBetter:
increment /= 2;
break;
case MatchResult::newIsBetter:
- // not reached yet, but cur.pos()+increment is bettert
+ // not reached yet, but cur.pos()+increment is better
mres = mres2;
firstInvalid -= increment;
if (increment > firstInvalid*3/4)
mres = mres2;
firstInvalid -= increment;
if (increment > firstInvalid*3/4)
if (mres.match_len > 0) {
if (mres.match_prefix + mres.pos - mres.leadsize > 0) {
// The match seems to indicate some deeper level
if (mres.match_len > 0) {
if (mres.match_prefix + mres.pos - mres.leadsize > 0) {
// The match seems to indicate some deeper level
orig_cur = cur;
orig_mres = mres;
cur.forwardPos();
continue;
}
}
orig_cur = cur;
orig_mres = mres;
cur.forwardPos();
continue;
}
}
// should never be reached.
cur = orig_cur;
mres = orig_mres;
// should never be reached.
cur = orig_cur;
mres = orig_mres;