Sublime Forum

Files with really long lines fail to open

#1

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. :smile:

0 Likes

#2

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.

0 Likes

#3

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.

0 Likes