Linguist: Lightshow gives illusion of Unicode-aware regexes

Created on 1 Nov 2017  Β·  5Comments  Β·  Source: github/linguist

Compare the third line here...

~console
$ command # Command
command # Output
Ξ» command # Command
command # Output
$ command # Command
~

... with how Lightshow claims it'll look:

Figure 1

Why this is happening

See atom/language-shellscript#85 for some backstory.

Basically, the grammar for highlighting snippets of terminal output (using ~~~console … ~~~) was updated so Greek characters could be used as prompt-string symbols. My own PS1 string uses a Lambda symbol, and I've seen many others use it too.

Only now I remembered GitHub parses text with Unicode features disabled for performance reasons. This comes from @vmg in his explanation in #3291:

… we don't currently use the PCRE_UCP flag because it's a really significant performance degradation. I acknowledge this is not an ideal answer -- I'm looking into the option to only enabling this flag on documents that we know contain extended Unicode characters, but we can't enable it by default because it really slows down syntax highlighting.

Lightshow should reflect this.

/cc @lildude @50Wliu

Why this is really happening. Nah, seriously.

EDIT: Because @Alhadis clearly can't wait longer than 30 minutes after a new Linguist release without expecting grammar updates to be visible.

Most helpful comment

I'm actually πŸ‡ΏπŸ‡¦ but live in πŸ‡¬πŸ‡§ so you can have a πŸ˜‚πŸ‡ΏπŸ‡¦πŸ€£πŸ‡¬πŸ‡§πŸ˜‚πŸ‡ΏπŸ‡¦πŸ˜‚πŸ‡¬πŸ‡§

All 5 comments

Note to self: wait a minimum of 9 hours before filing a grammar-related issue after a new Linguist release.

wat

/cc @kivikakk so she can laugh at me in Estonian

/cc @pchaigno so he can laugh at me in French

/cc @lildude so he can laugh at me in British

Haha I was confused as well :laughing:. To join in the laughing party, I'll laugh at you in Chinese!

I'm actually πŸ‡ΏπŸ‡¦ but live in πŸ‡¬πŸ‡§ so you can have a πŸ˜‚πŸ‡ΏπŸ‡¦πŸ€£πŸ‡¬πŸ‡§πŸ˜‚πŸ‡ΏπŸ‡¦πŸ˜‚πŸ‡¬πŸ‡§

GitHub: Where borders come to die.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philiparvidsson picture philiparvidsson  Β·  4Comments

haskellcamargo picture haskellcamargo  Β·  3Comments

BnSalahFahmi picture BnSalahFahmi  Β·  3Comments

siscia picture siscia  Β·  6Comments

lucasrodes picture lucasrodes  Β·  6Comments