aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-04-30 03:06:51 +0000
committernyamatongwe <devnull@localhost>2001-04-30 03:06:51 +0000
commit4153beee4eb5f64da22fe757a9ce4b05bcfe12df (patch)
tree116346405cdb37886408aa6f7c4b29fcabd08af0
parent09d42ffa21ce48f7ccd80c71674445bffe15cef1 (diff)
downloadscintilla-mirror-4153beee4eb5f64da22fe757a9ce4b05bcfe12df.tar.gz
When doing regexp searches, start position is moved on from end of line
or between lines. The last character of the search is found using length in case there are any nulls in the string.
-rw-r--r--src/Document.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index ef9779016..befae4570 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -836,11 +836,14 @@ long Document::FindText(int minPos, int maxPos, const char *s,
// Replace: $(\1-\2)
int lineRangeStart = LineFromPosition(startPos);
int lineRangeEnd = LineFromPosition(endPos);
+ if ((startPos >= LineEnd(lineRangeStart)) && (lineRangeStart < lineRangeEnd)) {
+ // the start position is at end of line or between line end characters.
+ lineRangeStart++;
+ startPos = LineStart(lineRangeStart);
+ }
int pos = -1;
int lenRet = 0;
- char searchEnd = '\0';
- if (*s)
- searchEnd = s[strlen(s) - 1];
+ char searchEnd = s[*length - 1];
if (*length == 1) {
// These produce empty selections so nudge them on if needed
if (s[0] == '^') {