diff options
-rw-r--r-- | src/Document.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 87a101822..6659f4f0c 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1005,7 +1005,7 @@ long Document::FindText(int minPos, int maxPos, const char *s, if (line == lineRangeStart) { if ((startPos != endOfLine) && (searchEnd == '$')) continue; // Can't match end of line if start position before end of line - endOfLine = startPos+1; + endOfLine = startPos; } } @@ -1017,10 +1017,10 @@ long Document::FindText(int minPos, int maxPos, const char *s, if (increment == -1) { // Check for the last match on this line. int repetitions = 1000; // Break out of infinite loop - while (success && (pre->eopat[0] <= (endOfLine+1)) && (repetitions--)) { - success = pre->Execute(di, pos+1, endOfLine+1); + while (success && (pre->eopat[0] <= endOfLine) && (repetitions--)) { + success = pre->Execute(di, pos+1, endOfLine); if (success) { - if (pre->eopat[0] <= (minPos+1)) { + if (pre->eopat[0] <= minPos) { pos = pre->bopat[0]; lenRet = pre->eopat[0] - pre->bopat[0]; } else { |