From 00c771cecda620db28cec9e4c50830f542e3a829 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 26 May 2012 15:15:07 +1000 Subject: Add GetRangePointer and GetGapPosition methods. --- doc/ScintillaDoc.html | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 9826e769c..c610b9c70 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -4770,6 +4770,8 @@ struct Sci_RangeToFormat { SCI_GETDIRECTFUNCTION
SCI_GETDIRECTPOINTER
SCI_GETCHARACTERPOINTER
+ SCI_GETRANGEPOINTER(int position, int rangeLength)
+ SCI_GETGAPPOSITION

On Windows, the message-passing scheme used to communicate between the container and @@ -4815,8 +4817,13 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ pass in the direct pointer associated with the target window.

SCI_GETCHARACTERPOINTER
- Move the gap within Scintilla so that the text of the document is stored consecutively - and ensure there is a NUL character after the text, then return a pointer to the first character. + SCI_GETRANGEPOINTER(int position, int rangeLength)
+ SCI_GETGAPPOSITION
+ Grant temporary direct read-only access to the memory used by Scintilla to store + the document.

+

SCI_GETCHARACTERPOINTER moves the gap within Scintilla so that the + text of the document is stored consecutively + and ensure there is a NUL character after the text, then returns a pointer to the first character. Applications may then pass this to a function that accepts a character pointer such as a regular expression search or a parser. The pointer should not be written to as that may desynchronize the internal state of Scintilla.

@@ -4833,6 +4840,15 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ each replacement then the operation will become O(n^2) rather than O(n). Instead, all matches should be found and remembered, then all the replacements performed.

+

SCI_GETRANGEPOINTER provides direct access to just the + range requested. The gap is not moved unless it is within the requested range so this call + can be faster than SCI_GETCHARACTERPOINTER. + This can be used by application code that is able to act on blocks of text or ranges of lines.

+ +

SCI_GETGAPPOSITION returns the current gap position. + This is a hint that applications can use to avoid calling SCI_GETRANGEPOINTER + with a range that contains the gap and consequent costs of moving the gap.

+

Multiple views

A Scintilla window and the document that it displays are separate entities. When you create -- cgit v1.2.3