Code::Blocks Forums

User forums => Help => Topic started by: void on January 05, 2009, 09:37:29 pm

Title: PHP syntax highlighting problem (bug?)
Post by: void on January 05, 2009, 09:37:29 pm
Hello,

I don't know if anyone else noticed this, at least I haven't been able to find any reports on this board.

In the most recent nightly builds (5322 and the one before I believe) the lexer/syntax highlighting for PHP code seems to be broken for some reason. I've attached two screenshots to show you what I mean.

The first one is right after opening the file - everthing seems to be okay.

The second one is made after selecting some characters with the mouse. Everything's highlighting at once. This is the actual problem I got with this one.
After selecting text the whole syntax highlighting get's screwed and it's not possible to recover from this situation without closing and reopening the file.

As my overall favorite C(++) IDE I used CB for PHP coding for ages without ever experiencing such a strange behaviour, right until - as I already said - the recent builds. Because of this my first thought was that this might be a bug in the lexer or at least something not expected to be there. I'm also sure that people coding PHP in CB might be a minority, so maybe noone noticed or told about it yet.

So, I anyone has an idea about fixing this issue I'd really appreciate that :)

Thank you very much!



[attachment deleted by admin]
Title: Re: PHP syntax highlighting problem (bug?)
Post by: dmoore on January 05, 2009, 10:16:25 pm
I'm guessing something to do with this:

http://svn.berlios.de/wsvn/codeblocks/trunk/?rev=5348&sc=1

Quote
- merged "scintilla" branch to trunk (r5247-r5320).
Title: Re: PHP syntax highlighting problem (bug?)
Post by: Jenna on January 05, 2009, 10:35:28 pm
I'm guessing something to do with this:

http://svn.berlios.de/wsvn/codeblocks/trunk/?rev=5348&sc=1

Quote
- merged "scintilla" branch to trunk (r5247-r5320).


I don't think so.

The last nightly was build before merging with new scintilla-branch.
Title: Re: PHP syntax highlighting problem (bug?)
Post by: dmoore on January 05, 2009, 11:12:47 pm
i stand corrected. possibly OP has copied the nightly into the same folder as an older nightly with incompatible data...
Title: Re: PHP syntax highlighting problem (bug?)
Post by: TDragon on January 06, 2009, 05:28:52 am
Nope, I have had the same problem with a couple of fresh installs and have ended removing .php from the syntax highlighting list. This problem has existed for at least a month or two, but I'm pretty sure it's not in 8.02.
Title: Re: PHP syntax highlighting problem (bug?)
Post by: dmoore on January 06, 2009, 03:27:15 pm
ok, I'm pretty sure the problem is "highlight occurrences" (or whatever the name of the feature is that highlights text that matches the selection) is using old-style indicators and there aren't enough spare style bits in the html/php lexer (it uses more than the other lexers). thus, setting the indicator corrupts the styling info.
Title: Re: PHP syntax highlighting problem (bug?)
Post by: Jenna on January 06, 2009, 04:07:25 pm
ok, I'm pretty sure the problem is "highlight occurrences" (or whatever the name of the feature is that highlights text that matches the selection) is using old-style indicators and there aren't enough spare style bits in the html/php lexer (it uses more than the other lexers). thus, the setting the indicator is corrupting the styling info.
If that's the case it should be fixed in next nightly.
With changeing to the new scintilla-version "Highlight Occurrences" and "Incremental Search" use modern indicators.

EDIT:

I just tested it on my xp-system at work. I have an older version and a brand-new test-version of C::B installed.
The old version with old-style indicators has the bug, the new version seems to work fine.
Title: Re: PHP syntax highlighting problem (bug?)
Post by: void on January 06, 2009, 04:45:53 pm
Let me see if I got this right:

So building from svn should fix the problem?
Title: Re: PHP syntax highlighting problem (bug?)
Post by: Jenna on January 06, 2009, 04:59:11 pm
Let me see if I got this right:

So building from svn should fix the problem?
Yes.
Title: Re: PHP syntax highlighting problem (bug?)
Post by: void on January 06, 2009, 05:31:25 pm
Okay, I just tried it and it works perfectly! Finally I got my good old C::B back :p

Again - Thanks very much for your help!