diff options
author | nyamatongwe <devnull@localhost> | 2011-02-10 09:42:29 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2011-02-10 09:42:29 +1100 |
commit | 4c09f98c7f268fc6bb72a261cb45de24e86fdbca (patch) | |
tree | 5b925a64d6a8ec9df80f3474e3e6c7b56eb57bd5 | |
parent | f51df2ca59cf06951c2cd422e593081a84bd22f7 (diff) | |
download | scintilla-mirror-4c09f98c7f268fc6bb72a261cb45de24e86fdbca.tar.gz |
Fix for backwards case-insensitive search in code page 936. Bug #3176271.
Was not finding each occurance of a given string due to misaligned
character access.
-rw-r--r-- | src/Document.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 91a0dda14..c0290936f 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1309,7 +1309,11 @@ long Document::FindText(int minPos, int maxPos, const char *search, //Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind); const int limitPos = Platform::Maximum(startPos, endPos); - int pos = forward ? startPos : (startPos - 1); + int pos = startPos; + if (!forward) { + // Back all of a character + pos = NextPosition(pos, increment); + } if (caseSensitive) { while (forward ? (pos < endSearch) : (pos >= endSearch)) { bool found = (pos + lengthFind) <= limitPos; |