News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

PHP syntax highlighting problem (bug?)

Started by void, January 05, 2009, 09:37:29 PM

Previous topic - Next topic

void

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]

dmoore

#1
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).
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

Jenna

Quote from: 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).


I don't think so.

The last nightly was build before merging with new scintilla-branch.

dmoore

i stand corrected. possibly OP has copied the nightly into the same folder as an older nightly with incompatible data...
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

TDragon

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.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

dmoore

#5
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.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

Jenna

#6
Quote from: 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, 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.

void

Let me see if I got this right:

So building from svn should fix the problem?

Jenna

Quote from: 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?
Yes.

void

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!