atom / language-csharp

C# language support for Atom
Other
62 stars 53 forks source link

Byte-order marker breaks highlighting of first line #79

Closed forivall closed 7 years ago

forivall commented 7 years ago

I'm noticing that a lot of files that I'm opening (likely created by Visual Studio) aren't having their first line highlighted properly. Then, I finally noticed that if i place my cursor at the beginning of the file, and hit backspace, it fixes it. This revealed that there was a no-space character at the beginning of the file that was there, which I guessed was a Unicode BOM.

With BOM: screen shot 2016-12-02 at 6 52 40 pm

Removed BOM: screen shot 2016-12-02 at 6 57 15 pm

Investigation: screen shot 2016-12-02 at 6 55 13 pm

This is probably a core issue, where Atom should detect utf-8 with BOM encoding (related: https://github.com/atom/atom/issues/3427).

damieng commented 7 years ago

Yeah, this is a core issue and affects many things - we'll close it here and track it on the bug you already linked. Thanks!