Home Download Buy Blog Forum Support

Files with really long lines fail to open

Files with really long lines fail to open

Postby Arkkimaagi on Tue Jul 05, 2011 8:48 pm

When I try to open an JSON data file that has a really long line in it (no newlines), Sublime Text 2 shows only a blank file. If I try to open any other file after that, it also looks like it's empty. I can fix this only by restarting Sublime Text 2.

The file is 388K in size and I have text-wrap on. I know that this is a borderline issue, but I thought that I'd report it as it's been bugging me. Especially the failure to open normal files after accidentally opening the data file.

I'm using OSX 10.6.6 and Sublime Text 2 build 2076

Thanks for a great tool, I'd love to see more ZenCoding support, but nonetheless, bought it to support the cause. :)
Arkkimaagi
 
Posts: 2
Joined: Tue Jul 05, 2011 8:42 pm

Re: Files with really long lines fail to open

Postby jps on Wed Jul 06, 2011 8:09 am

Some of the syntax definitions have regexes with an exponential complexity in the line length - JavaScript is one of these.

If you hit this, then a file will appear to never load, although depending on the contents of the file, it may do so within a few minutes. There should still be a progress bar shown for the file, although it won't appear to be moving. Opening further files with the same syntax will also not load until the regex engine has finished matching against the contents of the first file.

I replicated the issue here, and fixed the regex that was causing the issue for my test file - this fix will be in the next build. It'd be handy if you could email me the file in question so I can verify that the fix will cover you too.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Files with really long lines fail to open

Postby Arkkimaagi on Thu Jul 07, 2011 6:05 am

Ah, so "the glitch" was indeed a progress bar that I saw. It's kinda sleek, but I did not realize that it was a progress bar until you told me it was as it did not move or animate in any way.

Even if I close there problematic file, opening the next file has problems. The progress bar of the new file is at 100%, but the file wont open for a while. Maybe some sort of an rotating thing to show that work is being done, or some message about loading would be in order. Also it might be good to take a look at aborting the regexp if the file requesting it is closed.

Anyways, I sent you the file to your support email address.

Thanks again, I hope this helps.
Arkkimaagi
 
Posts: 2
Joined: Tue Jul 05, 2011 8:42 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 27 guests