sindresorhus / atom-editorconfig

Helps developers maintain consistent coding styles between different editors
https://atom.io/packages/editorconfig
MIT License
812 stars 80 forks source link

Highlight fails on ‘unset’ keyword #218

Closed valtlai closed 5 years ago

valtlai commented 6 years ago

I have .editorconfig like this:

root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

[*.php]
insert_final_newline = unset

[*.yml]
indent_style = space
indent_size = 2

The PHP section is highlighted like this:

The whole “insert_final_newline = unset” line is not highlighted.

If I change unset to false, it’s highlighted correctly:

If I give any property a value of unset, the whole line gets unhighlighted.

florianb commented 6 years ago

Hi @valtlai - thanks for reporting this. It will take me some time to look for this (looks like an issue with the regexes in the grammar).

You might fasten the process up if you're take a look yourself and file a PR. ☕️

Alhadis commented 5 years ago

Rewritten grammar completely to be more permissive and structured.

Don't worry, I've done this before. Like, uh, ~20 times.