Hi
I too get this on one of my projects, which also happens to be the one of the larger projects 10's of thousands of lines of code.
It is odd, in that if I open the project in Laz 1.3 with FPC 2.7.1 the behaviour does not happen.
This project has a lot of $IFDEF statemens; to cover various build mode for 32/64 bit Win, OSX etc as well as additional application features. It has approximately 14 Build Modes as standard.
I personaly think it has to do with this, as some of the build modes could actually create in itself a Blank Procedure Code Block ie simplified below.
Procedure form. SomeFunc:
Begin
{$Ifdef darwin}
{$ifdef cpu32}
{$else}
.. some code for 64 bit darwin
{$endIf}
{$elsef}
...... Some code for windows
{$endif}
End;
I spent over a week examine the code, and everything has it correct begin end; as indicated in the ide with the vertical lines showing the begin end matches, i even went to each begin so as to highlght it to make sure its corresponding end was also hilighted.
If you have procedure blocks where no code is in; then I found added some code that does nothing, will help in reducing it.
When it first started, everytime I created a new event, it would create nearly 30 empty events that were in various parts of the main project file; so took ages to remove them, now it just creates one empty one; and ironically it is placed immediately before the actually code???
At the moment I use the old lazarus version for this project, and when I added any changes etc,, I will then open and compile in new Lazarus for FPC 3.2/3.0.4 .
Also doing a Tools Scan Source did help a few times.
I had created a post about this a while ago, but cannot find it now.