atom / language-c

C support in Atom
Other
118 stars 152 forks source link

Code block disabled with #if 0 is not grayed out #335

Open barisdemiray opened 4 years ago

barisdemiray commented 4 years ago

Prerequisites

Description

A code block is not grayed out when it is disabled with #if 0 and a corresponding #endif.

Steps to Reproduce

  1. Type the snipped below and observe that it is highlighted as if it wasn't "disabled".
#if 0
        {
            cap >> frame;
            if (frame.empty())
            {
                waitKey();
                break;
            }
#endif

Expected behavior:

I'd expect it to be grayed out as if it was a comment line.

Actual behavior:

It is highlighted as if this block wasn't taken out of the build.

Reproduces how often:

Everytime.

Versions

Atom : 1.40.1 Electron: 3.1.10 Chrome : 66.0.3359.181 Node : 10.2.0

Additional Information

rsese commented 4 years ago

Thanks for the report! Reproduced with 1.42.0-nightly7 on macOS 10.14.6:

preprocessor-treesitter

For comparison with Tree-sitter disabled and checking the scopes for any of the greyed out text:

preprocessor-textmate