On Tue, 22 May 2007 09:53:07 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I want to try and implement that feature mentioned in the "New since
> Delphi 7..." article.
> 
> When you type 'begin' and press enter, the editor automatically
> inserts the blank line and the closing 'end;' keyword. Also it will
> use the correct indentation.
> 
> Now I have never done Code Generation with CodeTools, so might need
> some hints... I gather CodeTools has the capability for something like
> this? 

For simple things like begin/end, class/end we don't need the
codetools, but simple text code templates. For more complex tasks you
can use macro functions, which can trigger anything including the
codetools. See for example $ProcName().


> I know it must can via Ctrl+J, but can the keyword completion
> be triggered automatically?

Not yet. But this is easy to implement. 
The above examples (being/end) are triggered by pressing 'return'.
Of course not all templates should be triggered by pressing 'return',
so every template need an own set of triggers.
What about other triggers? For example space, tab, semicolon, ...


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to