mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 14:12:38 +02:00
Synedit: docs
git-svn-id: trunk@24205 -
This commit is contained in:
parent
654b36a727
commit
b6a5c48f8f
@ -1,6 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<fpdoc-descriptions>
|
||||
<package name="SynEdit">
|
||||
<descr>
|
||||
<p>Related Topics:</p>
|
||||
<p><link id="SynEditTextBase.TextBuffer and Views">TextBuffer and Views (Virtual Text Representation)</link></p>
|
||||
</descr>
|
||||
<module name="SynEdit">
|
||||
</module>
|
||||
</package>
|
||||
|
@ -44,6 +44,27 @@ This is used by SetCapacity and ItemPointer.</p>
|
||||
<p/>
|
||||
</descr>
|
||||
</element>
|
||||
<topic name="TextBuffer and Views">
|
||||
<short>TextBuffer and Views (Virtual Text Representation)</short>
|
||||
<descr>
|
||||
<p>SynEdit uses a concept of Text-Views. Those are virtual representations of the Text. A Text-View controls the way SynEdit sees the Text. Text-Views are sitting between the Textbuffer and SynEdit</p>
|
||||
<p>For Example, a text document may contain tabs. The user wants them to be displayed as Spaces instead, but does not want the stored document to be changed. A Text-View can do that. Since every access to the TextBuffer goes through the View, if SynEdit request some Text, the View can modify the returned result and replace Tabs</p>
|
||||
<p>Another Example would be a View modifying the data written to the Textbuffer. Such a View could replace Spaces that the User writes in SynEdit, and put appropriate Tabs into the Textbuffer</p>
|
||||
<p></p>
|
||||
<p>SynEdit needs no special knowledge about the Views, all Views have the same interface as the Textbuffer. This interface is defined in <link id="TSynEditStrings">TSynEditStrings</link>. Since Views act the same as the Textbuffer they can also be stacked, each View acting on the input/output of the next View. If a View does not need to modify a specific call to the textbuffer, it must simply forward it. A special base class provides the implementation: <link id="TSynEditStringsLinked">TSynEditStringsLinked</link></p>
|
||||
<p>Views allow to implement certain Tasks in a single place, and often without the need of making any modification to the code in SynEdit.</p>
|
||||
<p>In additon to the examples at the start of this doc, Views can also store additional data, which may not be needed (or wanted) to be written to the Textbuffer. An example for this is the trimming of trailing spaces. If the user inputs spaces at the end of line, they are treaded as uncommited text. They are stored in the View, untill they are either committed (along with other text entered after the spaces), or discarded (trimmed)</p>
|
||||
<p></p>
|
||||
<p></p>
|
||||
<p>Todos:</p>
|
||||
<p>Folding integration or generally integration of line-number remapping<br/>Highligher/Markup integration</p>
|
||||
<p></p>
|
||||
<p>List of Views</p>
|
||||
<p><link id="#SynEdit.SynEditTextTrimmer">TSynEditStringTrimmingList (trim trailing spaces)</link></p>
|
||||
<p><link id="#SynEdit.SynEditTextTabExpander">TSynEditStringTabExpander</link></p>
|
||||
<p><link id="#SynEdit.SynEditTextDoubleWidthChars">SynEditStringDoubleWidthChars</link></p>
|
||||
</descr>
|
||||
</topic>
|
||||
</module>
|
||||
</package>
|
||||
</fpdoc-descriptions>
|
||||
|
Loading…
Reference in New Issue
Block a user