Lazarus

Using the Lazarus IDE => General => Topic started by: Zvoni on October 20, 2020, 04:55:25 pm

Title: Laz 2.0.11 fixes-weird codecompletion with inc-files
Post by: Zvoni on October 20, 2020, 04:55:25 pm
Hi Folks,
not sure if i'm correct here.

Laz2.0.11-Rev 63876M - FPC3.2.1 on Manjaro 64-Bit

Working on a project i noticed something weird:

Add a unit and save it to the project.
Add another unit, delete everything (!) from it and save it as an inc-file ("somecode.inc").
Now, in the first unit, include the inc-file via Directive
{$I somecode.inc}
Save everything
switch back to the inc-file, and start writing a Function/Procedure
Code: [Select]
Procedure Dummy;
Begin
The moment i hit Enter after writing "Begin" i (and everyone else) expects an "end;" to appear.
It doesn't, as long as you're in the last line of code (meaning: No code further down).
But, the "end;" DOES appear, in the "main" file which includes the inc-file, and there it's appended to the end of the Include-Directive!

Can someone confirm?
Title: Re: Laz 2.0.11 fixes-weird codecompletion with inc-files
Post by: Handoko on October 20, 2020, 05:00:41 pm
Tested on Lazarus 2.0.10 Linux GTK2.
I can reproduce the issue.
Title: Re: Laz 2.0.11 fixes-weird codecompletion with inc-files
Post by: JuhaManninen on October 20, 2020, 09:14:34 pm
There is a bug report about it from 7 years ago by Bart :
 https://bugs.freepascal.org/view.php?id=24950
Somebody should fix it.
It is assigned to Mattias but patches from anybody are welcome.
Title: Re: Laz 2.0.11 fixes-weird codecompletion with inc-files
Post by: Zvoni on October 20, 2020, 10:00:39 pm
Ouch! Sorry, didn't see that.
Not really an Issue, just annoying.

I helped myself by inserting a Dummy-Procedure at the end, and just coding above it, and pushing the dummy-procedure downwards.
Code: [Select]
Procedure Dummy;
Begin
End;
TinyPortal © 2005-2018