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 255965 - Syntax highlighter goes wrong for C++ headers
Summary: Syntax highlighter goes wrong for C++ headers
Status: RESOLVED DUPLICATE of bug 255933
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-16 06:52 UTC by mariusz_m
Modified: 2015-10-21 18:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
wrong syntax hl (45.06 KB, image/png)
2015-10-16 06:53 UTC, mariusz_m
Details
correct syntax hl (57.69 KB, image/png)
2015-10-16 06:53 UTC, mariusz_m
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mariusz_m 2015-10-16 06:52:27 UTC
I have this issue for so long that I eventually decided to report this bug.

Basically, I don't understand why someone decided to create three separate highlighters for C/C++/header - I need to set the same properties thrice which is very inconvenient, and no way to copy one to another or inherit from another one.

But what I'm going to tell is:
when editing header file (*.h, not .c, not .cpp) it looks like the text is modified, but separate buffer of letters attributes stays unaltered, resulting in weird looking of the code. 

See the attached images.
Closing and reopening the file won't help - I need to 
[Code Assistance -> Reparse project]

For a few months I'm forced to use Eclipse based IDE in parallel, and when NB is in my opinion much better code editor, Eclipse highlighter is simply perfect. More options, easier to configure, always correct.
Comment 1 mariusz_m 2015-10-16 06:53:19 UTC
Created attachment 156755 [details]
wrong syntax hl
Comment 2 mariusz_m 2015-10-16 06:53:40 UTC
Created attachment 156756 [details]
correct syntax hl
Comment 3 Alexander Simon 2015-10-16 07:01:03 UTC
It looks like a duplicate of the bug #255933.
Please conform.
Comment 4 mariusz_m 2015-10-16 07:24:01 UTC
Yes - it looks similar. 
Interesting - adding the header into project Header Files folder solves the problem? I'll check it
Comment 5 Alexander Simon 2015-10-16 08:04:10 UTC
(In reply to mariusz_m from comment #4)
> Yes - it looks similar. 
> Interesting - adding the header into project Header Files folder solves the
> problem? I'll check it

IDE treat external (from project point of view) headers as library headers.
IDE considers library headers as reуd only and unchangeable.
As result IDE does not support modifications in library headers.

If you include a library header in the project, IDE will reflect code model changes when the header is changed.
Comment 6 Alexander Simon 2015-10-16 08:05:11 UTC
(In reply to Alexander Simon from comment #5)
> IDE considers library headers as reуd only and unchangeable.

reуd = read ;-)
Comment 7 mariusz_m 2015-10-16 08:20:50 UTC
Yes - it looks similar. 
Interesting - adding the header into project Header Files folder solves the problem? I'll check it(In reply to Alexander Simon from comment #5)
> (In reply to mariusz_m from comment #4)
> > Yes - it looks similar. 
> > Interesting - adding the header into project Header Files folder solves the
> > problem? I'll check it
> 
> IDE treat external (from project point of view) headers as library headers.
> IDE considers library headers as reуd only and unchangeable.
> As result IDE does not support modifications in library headers.
> 
> If you include a library header in the project, IDE will reflect code model
> changes when the header is changed.

This sounds reasonable - thanks for explanation.

In this case, IDE could detect that external file is modified and during saving  propose/suggest adding it into the project tree. Otherwise how many peoples are aware of it?
Comment 8 Alexander Simon 2015-10-21 18:59:52 UTC

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