From 1a05a259558efd7dffb118ca9b12257a1346d2ea Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 29 Jun 2013 20:32:52 +1000 Subject: Bug: [#1483]. Split GetRelativePosition into 2 calls one for moving between character positions and the other for retrieving a character and width. --- doc/ScintillaDoc.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index abec92a5b..19829cbd8 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -82,7 +82,7 @@

Scintilla Documentation

-

Last edited 5/May/2013 NH

+

Last edited 29/June/2013 NH

There is an overview of the internal design of Scintilla.
@@ -1344,7 +1344,7 @@ struct Sci_TextToFind {

SCI_GETLINESELSTARTPOSITION(int line)
SCI_GETLINESELENDPOSITION(int line)
Retrieve the position of the start and end of the selection at the given line with - INVALID_POSITION returned if no selection on this line.

+ INVALID_POSITION returned if no selection on this line.

SCI_MOVECARETINSIDEVIEW
If the caret is off the top or bottom of the view, it is moved to the nearest line that is @@ -6322,17 +6322,22 @@ exception options.

To allow lexers to determine the end position of a line and thus more easily support Unicode line ends IDocument is extended to IDocumentWithLineEnd.

-

The GetRelativePosition method allows navigating the document by whole characters and provides a standard +

GetRelativePosition navigates the document by whole characters, +returning INVALID_POSITION for movement beyond the start and end of the document.

+

GetCharacterAndWidth provides a standard conversion from UTF-8 bytes to a UTF-32 character or from DBCS to a 16 bit value. -Invalid UTF-8 is reported as a character for each byte with values 0xDC80+byteValue, which are +Bytes in invalid UTF-8 are reported individually with values 0xDC80+byteValue, which are not valid Unicode code points. +The pWidth argument can be NULL if the caller does not need to know the number of +bytes in the character.

class IDocumentWithLineEnd : public IDocument {
public:
        virtual int SCI_METHOD LineEnd(int line) const = 0;
-        virtual int SCI_METHOD GetRelativePosition(int start, int characterOffset, int *character, int *width) const = 0;
+        virtual int SCI_METHOD GetRelativePosition(int positionStart, int characterOffset) const = 0;
+        virtual int SCI_METHOD GetCharacterAndWidth(int position, int *pWidth) const = 0;
};
-- cgit v1.2.3