String of text causes CPU to 100%

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

String of text causes CPU to 100%

Quinn Comendant
If I open a Plain Text window and paste in the following line of text, TextMate 2.0.3 CPU usage goes to 100% and never stops. Syntax highlighting ends at the line containing the text. Here's the string:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: String of text causes CPU to 100%

Carpii UK
I cant reproduce this. 

But what syntax highlighting are you referring to? There's no syntax highlighting for a Plain text file, unless I'm missing something?

On Thu, 26 Dec 2019 at 21:03, Quinn Comendant <[hidden email]> wrote:
If I open a Plain Text window and paste in the following line of text, TextMate 2.0.3 CPU usage goes to 100% and never stops. Syntax highlighting ends at the line containing the text. Here's the string:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: String of text causes CPU to 100%

Quinn Comendant
I first noticed this in a php file, but it also happens in a plain text file. This is something recent. I open the file with this string regularly, and I didn't notice the problem until yesterday. 

Is there a way to disable bundle items to identify which might be causing the problem?

Quinn

-- 
Sent from my mobile device; please excuse the terseness and typos.

On Dec 26, 2019, at 15:09, Carpii UK <[hidden email]> wrote:


I cant reproduce this. 

But what syntax highlighting are you referring to? There's no syntax highlighting for a Plain text file, unless I'm missing something?

On Thu, 26 Dec 2019 at 21:03, Quinn Comendant <[hidden email]> wrote:
If I open a Plain Text window and paste in the following line of text, TextMate 2.0.3 CPU usage goes to 100% and never stops. Syntax highlighting ends at the line containing the text. Here's the string:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate

_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: String of text causes CPU to 100%

Carpii UK
Do you have any custom bundles? If not, Id suggest reinstalling to see if that helps.

If it doesn't, maybe you could try producing the smallest file which still exhibits the problem, and then we can confirm if it affects everyone or if it's just your setup.

On Thu, 26 Dec 2019 at 22:42, Quinn Comendant <[hidden email]> wrote:
I first noticed this in a php file, but it also happens in a plain text file. This is something recent. I open the file with this string regularly, and I didn't notice the problem until yesterday. 

Is there a way to disable bundle items to identify which might be causing the problem?

Quinn

-- 
Sent from my mobile device; please excuse the terseness and typos.

On Dec 26, 2019, at 15:09, Carpii UK <[hidden email]> wrote:


I cant reproduce this. 

But what syntax highlighting are you referring to? There's no syntax highlighting for a Plain text file, unless I'm missing something?

On Thu, 26 Dec 2019 at 21:03, Quinn Comendant <[hidden email]> wrote:
If I open a Plain Text window and paste in the following line of text, TextMate 2.0.3 CPU usage goes to 100% and never stops. Syntax highlighting ends at the line containing the text. Here's the string:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~:/?#[]@!$&'()*+,;=


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate

_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate

_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate


_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: String of text causes CPU to 100%

Jacob Carlborg
In reply to this post by Quinn Comendant


On 26 Dec 2019, at 23:42, Quinn Comendant <[hidden email]> wrote:

Is there a way to disable bundle items to identify which might be causing the problem?

If you open the bundle editor and select a bundle item, then there’s a checkbox in the drawer to enable/disable the item. It works both for whole bundles and individual bundle items.

--
/Jacob Carlborg



_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: String of text causes CPU to 100%

Quinn Comendant
On 27 Dec 2019 10:03:52, Jacob Carlborg wrote:
> If you open the bundle editor and select a bundle item, then there’s
> a checkbox in the drawer to enable/disable the item.

Thanks. By process of elimination, I was able to narrow the problem down to a language grammar I had modified: `Mail.tmbundle/Syntaxes/Email Address.tmLanguage`.

I changed this:

        (?i)\b([A-Z][A-Z0-9._%+-]+)@([A-Z0-9.\-]+)\.([A-Z]{2,4})\b

To this:

        (?i)\b([A-Z0-9][A-Z0-9._%+-]+)+@([A-Z0-9.\-]+)\.([A-Z]{2,4})\b

Which apparently causes infinite parsing, although I can't see why.

I was trying to fix the regex so that it will match email addresses containing dots or beginning with a number, e.g.:

This is correctly identified as markup.underline.link.email.hyperlink:

        [hidden email]

But these are not:

        [hidden email]
        [hidden email]

Any help would be appreciated how to get those email addresses to parse too.

Regards,
Quinn




_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate

Screen Shot 2020-01-02 at 22.02.53.png (28K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: String of text causes CPU to 100%

Jacob Carlborg

On 3 Jan 2020, at 05:07, Quinn Comendant <[hidden email]> wrote:

Thanks. By process of elimination, I was able to narrow the problem down to a language grammar I had modified: `Mail.tmbundle/Syntaxes/Email Address.tmLanguage`.

I changed this:

(?i)\b([A-Z][A-Z0-9._%+-]+)@([A-Z0-9.\-]+)\.([A-Z]{2,4})\b

To this:

(?i)\b([A-Z0-9][A-Z0-9._%+-]+)+@([A-Z0-9.\-]+)\.([A-Z]{2,4})\b

Which apparently causes infinite parsing, although I can't see why.

I don’t think you should have `+` before `@`.

-- 
/Jacob Carlborg



_______________________________________________
TextMate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate