diff options
author | nyamatongwe <devnull@localhost> | 2010-08-27 11:30:04 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2010-08-27 11:30:04 +1000 |
commit | 4a9fbef1362dd474132f0fd7dd35146ae91b716e (patch) | |
tree | ceaee2aad2e8b802868c8ad54221fc64ab3ecfb3 /src | |
parent | bc7c83a7e3ba98347c17d2d3b533aa19b7c59d62 (diff) | |
download | scintilla-mirror-4a9fbef1362dd474132f0fd7dd35146ae91b716e.tar.gz |
NextPosition treats \r\n as two characters as this allows searching for \n.
Diffstat (limited to 'src')
-rw-r--r-- | src/Document.cxx | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 82264021c..bf49cef2f 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -468,8 +468,6 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) { return pos - 1; } - // Not between CR and LF - if (dbcsCodePage) { if (SC_CP_UTF8 == dbcsCodePage) { unsigned char ch = static_cast<unsigned char>(cb.CharAt(pos)); @@ -516,6 +514,7 @@ int Document::MovePositionOutsideChar(int pos, int moveDir, bool checkLineEnd) { // NextPosition moves between valid positions - it can not handle a position in the middle of a // multi-byte character. It is used to iterate through text more efficiently than MovePositionOutsideChar. +// A \r\n pair is treated as two characters. int Document::NextPosition(int pos, int moveDir) { // If out of range, just return minimum/maximum value. int increment = (moveDir > 0) ? 1 : -1; @@ -524,17 +523,6 @@ int Document::NextPosition(int pos, int moveDir) { if (pos + increment >= Length()) return Length(); - // PLATFORM_ASSERT(pos > 0 && pos < Length()); - if (moveDir > 0) { - if (IsCrLf(pos)) - return pos + 2; - } else { - if ((pos >= 2) && IsCrLf(pos-2)) - return pos - 2; - } - - // Not between CR and LF - if (dbcsCodePage) { if (SC_CP_UTF8 == dbcsCodePage) { pos += increment; |