[Gambas-user] Bug in Highlight in Gambas 3.7.1

willy at ...3474... willy at ...3474...
Thu Jun 11 23:11:09 CEST 2015


On 2015-06-11 03:19, Benoît Minisini wrote:
> Le 11/06/2015 02:40, willy at ...3474... a écrit :
>> Hi All,
>> 
>> I recently discovered that highlight fdoesn't on Gambas 3.7.1 as it 
>> did
>> in previous versions.
>> I have a textEditor application (gbEdit) that uses a Editor (from
>> qt4.ext) and heavily relies on highlight for highlighting Gambas code,
>> difference files, html files, gambas webpages and so on.
>> 
>> As I said, this worked great with Gambas 3.5.x and Gambas 3.6.x.
>> I made a small project (attached) to show what I mean.
>> 
>> i tested it with a difference file.
>> Opening the file and going to menu View -> Difference file on Gambas
>> 3.5.4 shows a correctly highlighted difference file (see screen).
>> 
>> Opening the same difference file and going to menu View -> Difference
>> file on Gambas 3.7.1 crashes the application (see screen).
>> 
>> Same goes for C, CPlusPlus, CSS, HTML, Javascript, HTML and SQL (oh 
>> and
>> Webpage although it isn't in the example code attached). All work well
>> on Gambas 3.5.x and 3.6.x but crash the app on Gambas 3.7.1
>> 
>> Is this a bug or has something changed?
>> 
>> gbWilly
>> 
> 
> I have no idea why, as the Editor is used by the IDE, and every
> highlighting works in it. Can you check that?

Hi,

Gambas 3.7.1 IDE highlights just fine.

I have done some investigation and this is what I discovered.

1. When application installed on a system with Gambas 3.7.1 IDE 
installed all highlighting works.
2. When application installed on a virgin system (so no Gambas installed 
only PPA available in sources.list) the highlighting crashes.
3. If, on the virgin system (mentioned in 2. and after having 
application installed), I next install gambas3-gb-eval-highlight, the 
highlighting does work
4. The systems with Gambas 3.5.4 and 3.6.2 installed where the 
application was tested, all happened to have Gambas IDE installed, so 
that is why all worked there.

The misleading thing here is that when developing in IDE and no 
component gb.eval.highlight selected in project properties, you can use 
Highlight.C or whatever and there is no complain about a component 
missing when compiling and running the app.
When for example you use args in code but forget to select gb.args in 
properties, as soon as you compile or whant to run the app, the IDE 
tells you that ist doesn't understand the args code.

So, eventually, when making a package of the project, there is no 
dependency on gb.eval.highlight, and thus the application will fail on 
systems without a full IDE installed.

So, when using gb.eval.highlight without it being selected in project 
properties, IDE should complain.
Or maybe gb.qt4.ext should default depend on gb.eval.highlight?

Well, I solved the problem by checking gb.eval.highlight in the project 
properties and next repackage the project. So, now I know and will 
remember, but others might run into the same problem.

So, I feel something should be done to prevent mistakes like this from 
happening. But, I leave that up to Benoît to figure out the best 
solution (if any).

Willy (a.k.a. gbWilly)






More information about the User mailing list