SublimeText / CoffeeScript

Syntax highlighting and checking, commands, shortcuts, snippets, watched compilation and more.
439 stars 64 forks source link

Causes Sublime to use 100% CPU on save #193

Open joual opened 10 years ago

joual commented 10 years ago

Working on a relatively large project mostly made of .py/.js/.coffee files and every time I save a file (even just a python file, without any js file open) it causes a CPU spike for several seconds from sublime 3, which consumes 100% CPU. I narrowed it down to this package by installing only this one and seeing the same pattern. I changed the package's user settings to pretty much all false to try and stop the indexing but nothing changed.

Edit: For what it's worth, reverting CoffeeScript.tmLanguage and CoffeeScript_Literate.tmLanguage to what they were a couple days ago fixes the issue.

markalfred commented 10 years ago

That edit just broke my heart :disappointed:

Thanks for the detailed report, I'll take a look asap!

joual commented 10 years ago

So, for a piece of regex which causes catastrophic backtracking for the commit 26dbc4ec0928b002d707eaf8705228b59d06b7be .

(for the regex /(?![\s=/*+{}?])(\\.|.)*?/[igmy]{0,4}(?![a-zA-Z0-9]))

"<li><a>" + status + "</a></li>" + "<li><a id=\"start-offline\" href=\"#offline_mode\" data-role=\"button\" data-icon=\"arrow-r\" data-iconpos=\"bottom\">Test</a></li>" + "<li><a href=\"#sync_survey\" data-role=\"button\" data-icon=\"refresh\" data-iconpos=\"bottom\">Test</a></li>" + "<li class=\"nfc\"><a href=\"#survey-options\"  data-role=\"button\" data-icon=\"gear\" data-iconpos=\"bottom\">Options</a></li>" + "</ul>"

Here's a link to see that it causes the issue : http://regex101.com/r/pQ5lB6/1

sciyoshi commented 9 years ago

Any word on this? Can that commit be reverted until a better fix is found?

vmkcom commented 8 years ago

any updates? CoffeeScript highlighting causes Sublime Text 3 to crash sometimes on big files