Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-01

how I can use the component TSynEditAutoComplete

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Napoles Martinez

Hi ,how I can use the component TSynEditAutoComplete. I'm looking the sourceeditor.pp.
I want to do something like this:
arrayd and when ,I pressed ctrl+j

insert for example:
array[0|..1] of Type;
 and when press tab,  move the cursor to the next param
array[0..1|] of Type; //Tab
array[0..1] of Type|;

like the Lazarus Code editor.

for now the result I get is this:
array[$param(0)..$param(1)] of $param(Type); |

Thanks for your attention.

sorry for my english.

********************************************************************* En la tierra hace falta personas que trabajen m?s y critiquen menos, que construyan m?s y destruyan menos, que prometan menos y resuelvan m?s que esperen recibir menos y dar m?s que digan mejor ahora que ma?ana. Che *********************************************************************

Reply by email

Martin
to Reinier Napoles Martinez
Reinier Napoles Martinez wrote 11 lines
I want to do something like this: arrayd and when ,I pressed ctrl+j insert for example: array[0|..1] of Type; and when press tab, move the cursor to the next param array[0..1|] of Type; //Tab array[0..1] of Type|; like the Lazarus Code editor.

Look at TSynPluginTemplateEdit in ide\sourcesyneditor.pas

You do need to parse the "param()", that isn't done by SynEdit, but the IDE
- the search starts in ide\codetemplatesdlg.pas line 790
- and probably ide\codemacroprompt.pas ExecuteCodeTemplate()

It's a long time since I looked at that...

Reply by email