This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 184308

Summary: PHP code editor incorrectly colors some operators and separators.
Product: php Reporter: clutterskull
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: RESOLVED DUPLICATE    
Severity: normal CC: clutterskull, daku, fzamboj, LuxZg
Priority: P4    
Version: 7.0.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Examples of correct and incorrect coloring behavior in php code.
Options pane for PHP -> Operators
Options pane for PHP -> Separators

Description clutterskull 2010-04-15 21:51:52 UTC
In the PHP code editor, coloring preferences are not applied to some operators, for instance, '=' is not colored according to the operator rule but '.=' is.

Also brackets, braces, and parenthesis are not colored according to the separator rule as they are in other languages, while semicolons are colored properly.

A screenshot of the coloring on various elements is attached and can be seen at: http://cl.ly/LNP
Additionally, color settings for Operators can be seen at: http://cl.ly/6OR
and Separators at: http://cl.ly/MFx
Comment 1 clutterskull 2010-04-15 21:52:20 UTC
Created attachment 97491 [details]
Examples of correct and incorrect coloring behavior in php code.
Comment 2 clutterskull 2010-04-15 21:52:56 UTC
Created attachment 97492 [details]
Options pane for PHP -> Operators
Comment 3 clutterskull 2010-04-15 21:53:18 UTC
Created attachment 97493 [details]
Options pane for PHP -> Separators
Comment 4 clutterskull 2010-04-15 22:17:12 UTC
With a little more testing it seems that this issue affects operators with only one character (=, +, >, ., etc), while operators with multiple characters (==, >=, ->, etc) are colored properly.
Comment 5 clutterskull 2010-04-16 22:38:43 UTC
Confirmed that this issue also exists in 6.9M1 Mac
Comment 6 Filip Zamboj 2010-04-19 13:05:20 UTC
reproduced in 
Product Version: NetBeans IDE Dev (Build 100418-38937479e21f)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

1. change tools -> options -> fonts and colors -> syntax -> operators to whatever else color but default 
2. example is correct but the mistake is in editor, colors (for- and background) are not assigned to 'one character' operators but are to 'two characters' operators
Comment 7 Filip Zamboj 2010-09-15 12:31:20 UTC
batch reassigning
Comment 8 Ondrej Brejla 2011-08-16 09:38:11 UTC
Still reproducible in NB 7.0.1.
Comment 9 Petr Pisl 2011-09-26 14:26:08 UTC
The problem is in lexer, that produce "wrong" tokens. '=' is PHP_TOKEN like '.' or ')' etc, but "==" or "+=" is PHP_OPERATOR. Needs to be corrected in PHPColoringLexer and then assign the right category for the tokens.
Comment 10 jachmal 2011-10-24 06:05:59 UTC
Hi,

When this bug will be fixed?

Thanks.
Comment 11 LuxZg 2012-03-13 12:38:14 UTC
Still isn't fixed in 7.1.1

Highlighting parenthesis/braces/brackets and single character operators is always going back to default.

Interesting, when selecting parenthesis/braces/brackets their match/mismatch is highlighted correctly (both foreground and background).

Only way to change their color is changing the colors for All Languages -> Default, which in turn requires manual changing of all other colors that "inherit" this value.
Comment 12 Ondrej Brejla 2012-11-06 14:21:44 UTC

*** This bug has been marked as a duplicate of bug 215718 ***