[Lazarus] Format code on Save

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Thu Feb 23 01:40:13 CET 2017


On 2017-01-27 14:37, Mattias Gaertner via Lazarus wrote:
> I added the event.
> 
> uses LazIDEIntf
> 
> LazarusIDE.AddHandlerOnSaveEditorFile(@YourEvent);


A bit late, but thank you for adding that functionality. I've now
managed to create my IDE add-on and it works.

But I noticed that with every save (Ctrl+S), the YourEvent gets called
twice?  Any idea why that is, and if it was by design or a bug?

For example, I added a simple writeln() in my event handler and ran
Lazarus from the command line to see the output. I changed a unit and
pressed Ctrl+S. The writeln() output is shown twice...

===========================
[lazarus]$ ./lazarus
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions]
PrimaryConfigPath="/home/graemeg/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions]
SecondaryConfigPath="/etc/lazarus"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-freebsd-gtk2
New=x86_64-freebsd-gtk2 FPC=True LCL=False
PASS: We found the JCF command
PASS: We found the JCF command
===========================

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list