Sign in Join

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

Mailing lists / lazarus / 2016-07

Improvement: Lazarus editor (synedit)

10 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Fabio Luis Girardi

Hi!

Currently Lazarus Editor (synedit), with a text selected, If I press

(

It erases my selection and replace it by (

Is much harder to change this to, when press ( do (my selection), instead of erase and replace my selection by ( ?

If it's easy to do, somebody can point me where I have to change to get this feature?

This is a very useful feature when writing conditions on if and while statements.

The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160707/6b98dd00/attachment.html>

Reply by email

Graeme Geldenhuys
to Fabio Luis Girardi
Fabio Luis Girardi wrote
This is a very useful feature when writing conditions on if and while statements.

Does Lazarus IDE support Macros? If so, that could be an even easier solution producing the same end result. Make a selection, trigger the macro with a custom keyboard shortcut, and the macro does the rest by using the selection.

Regards,
Graeme

Reply by email

Lukasz Sokol
to Fabio Luis Girardi: Hi! Currently Lazarus Editor (synedit), with a text selected, If I press ( It erases my…
Fabio Luis Girardi wrote 14 lines
Hi! Currently Lazarus Editor (synedit), with a text selected, If I press ( It erases my selection and replace it by ( Is much harder to change this to, when press ( do (my selection), instead of erase and replace my selection by ( ? If it's easy to do, somebody can point me where I have to change to get this feature? This is a very useful feature when writing conditions on if and while statements.

In 1.4.4 I have

select text -> right click -> Source -> Enclose selection...* but it does not have ( ) as options,

maybe newer ones have ?

* and it has keyboard shortcuts to reach it too

-L.

Show quoted text 7 lines
-- The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com

Reply by email

Graeme Geldenhuys
to Lukasz Sokol
Lukasz Sokol wrote
select text -> right click -> Source -> Enclose selection...* but it does not have ( ) as options,

Wow, and so I learned another new feature of Lazarus IDE. :) Some of those options I’ll be using often from now onwards.

Regards,
Graeme

Reply by email

Fabio Luis Girardi
to Lukasz Sokol: In 1.4.4 I have select text -> right click -> Source -> Enclose selection...* but it does…

2016-07-07 10:31 GMT-03:00 Lukasz Sokol :

Show quoted text 9 lines
In 1.4.4 I have select text -> right click -> Source -> Enclose selection...* but it does not have ( ) as options, maybe newer ones have ?

No, Lazarus trunk don't have ( ) as option.

The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160707/5aad2a05/attachment.html>

Reply by email

Martin Frb
to Fabio Luis Girardi: Hi! Currently Lazarus Editor (synedit), with a text selected, If I press ( It erases my…
Fabio Luis Girardi wrote
Is much harder to change this to, when press ( do (my selection), instead of erase and replace my selection by ( ?

http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Macros http://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript

Assign the below macro to the ( key/keycombo

begin
   if caller.SelAvail then begin
     caller.SelText := '('+caller.SelText+')';
   end
   else
     ecChar('(');
end.

Reply by email

Fabio Luis Girardi
to Martin Frb

2016-07-07 11:21 GMT-03:00 Martin Frb :

Show quoted text 20 lines
On 07/07/2016 13:36, Fabio Luis Girardi wrote: > > Is much harder to change this to, when press ( do (my selection), instead > of erase and replace my selection by ( ? > > http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Macros http://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript Assign the below macro to the ( key/keycombo begin if caller.SelAvail then begin caller.SelText := '('+caller.SelText+')'; end else ecChar('('); end.

Should I to install some package on Lazarus to get this?

The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160707/2ad5e0da/attachment.html>

Reply by email

Martin Frb
to Fabio Luis Girardi: 2016-07-07 11:21 GMT-03:00 Martin Frb : Should I to install some package on Lazarus to…
Fabio Luis Girardi wrote 15 lines
2016-07-07 11:21 GMT-03:00 Martin Frb < <mailto:>>: On 07/07/2016 13:36, Fabio Luis Girardi wrote: Is much harder to change this to, when press ( do (my selection), instead of erase and replace my selection by ( ? http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Macros http://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript Should I to install some package on Lazarus to get this?

Editor Macros are available by default.

The Pascal script has a selftest however. Open the options from Tools menu, and search for editor macros to see if it passed.

"Editor Macros" is an entry in the view menu. See the wiki pages I linked.

Note, ensure you move the macro into the "IDE" section. Or you may loose it. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160707/2d632a71/attachment.html>

Reply by email

Martin Frb
to Graeme Geldenhuys: How do you assign keyboard shortcuts to macros. The “Edit Key” button is always…
Graeme Geldenhuys wrote 6 lines
On 2016-07-07 15:21, Martin Frb wrote: > Assign the below macro to the ( key/keycombo How do you assign keyboard shortcuts to macros. The “Edit Key” button is always greyed out.

Select an existing Macro in the list of macros (so it gets focused). Then the button become enabled. At least for me.

Make sure you move Macros to the IDE section (or Project) if you want to keep them.

Macros are also listed in the "Key Mapping" in options

Reply by email