diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx index 47d7c90eb..db93f7426 100644 --- a/scintilla/src/Document.cxx +++ b/scintilla/src/Document.cxx @@ -549,7 +549,7 @@ int Document::NextPosition(int pos, int moveDir) { // See http://msdn.microsoft.com/en-us/library/cc194792%28v=MSDN.10%29.aspx // http://msdn.microsoft.com/en-us/library/cc194790.aspx if ((pos - 1) <= posStartLine) { - return posStartLine; + return posStartLine - 1; } else if (IsDBCSLeadByte(cb.CharAt(pos - 1))) { // Must actually be trail byte return pos - 2;