Author Topic: PHP syntax highlighting problem (bug?)  (Read 3966 times)

Offline void

  • Single posting newcomer
  • *
  • Posts: 7
PHP syntax highlighting problem (bug?)
« 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]

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: PHP syntax highlighting problem (bug?)
« Reply #1 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).
« Last Edit: January 05, 2009, 10:35:18 pm by jens »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: PHP syntax highlighting problem (bug?)
« Reply #2 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.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: PHP syntax highlighting problem (bug?)
« Reply #3 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...

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: PHP syntax highlighting problem (bug?)
« Reply #4 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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: PHP syntax highlighting problem (bug?)
« Reply #5 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.
« Last Edit: January 06, 2009, 06:47:13 pm by dmoore »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: PHP syntax highlighting problem (bug?)
« Reply #6 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.
« Last Edit: January 06, 2009, 04:22:05 pm by jens »

Offline void

  • Single posting newcomer
  • *
  • Posts: 7
Re: PHP syntax highlighting problem (bug?)
« Reply #7 on: January 06, 2009, 04:45:53 pm »
Let me see if I got this right:

So building from svn should fix the problem?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: PHP syntax highlighting problem (bug?)
« Reply #8 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.

Offline void

  • Single posting newcomer
  • *
  • Posts: 7
Re: PHP syntax highlighting problem (bug?)
« Reply #9 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!