Sublime Forum

Dev Build 3069

#5

God, i love when builds start getting out one after the other. :smiley:

Is it possible to make opening large files faster ?
A 6 MB sql file takes about 8 or 9 seconds to open, while in notepad++ it opens instantaneously.

0 Likes

#6

OS X here. If I run subl . on my home directory, ST is literally unusable. It beach balls for a while and eventually I have to Force Quit it. I’ve uninstalled every plugin and this still happens (actually my install today was a fresh machine). If I open a smaller directory, it’s still incredibly slow with about a 4 second lag. This is on a retina iMac with 32GBs of RAM and SSD, so I don’t think it’s the machine. Thoughts?

0 Likes

#7

Not sure if the same problem, but subl doesn’t work at all for me (OSX Yosemite) since build 3067. It just opens sublime without the directory/file.

0 Likes

#8

Package Control stopped working for me, has anyone else seen this? I’m on Yosemite…

0 Likes

#9

Actually, that’s working for me and it hasn’t in a long time. But once I get a directory open, the machine just hangs. I just tried it on a one file directory and it still just hangs so it doesn’t appear to be size related.

0 Likes

#10

This is likely an issue with Package Control itself and its update to 3.0.1. Refer to the IRC channel or the package repo, but first try this.

0 Likes

#11

Exactly right, thanks!

0 Likes

#12

jps Url open regex is still a bit too greedy as it includes things like periods at the end of the regex. I realize my example regex I posted in the other thread may have been difficult to follow as I had not cleaned it up, so I have cleaned it up here with a bit more comments explaining what it is targeting and why. I use it in a number of projects, and it seems to handle urls quite well. I won’t dare say it is perfect and it won’t ever need tweaking, but I have found it to be quite reliable for my use cases. Hopefully, it can help you fine tune yours:

[pre=#232628]rex = re.compile(
r’’’(?x)(?i)
\b(?:
https?://(?:(?:a-z\d-]+(?:.a-z\d-.]+)+)|localhost)| # http://
w{3}.a-z\d-]+(?:.a-z\d-.]+)+ # www.
)
/?a-z\d-.?,!’(){}\]/+&@%$#=:"|~;]* # url path and querry stuff
a-z\d-
~:/#@$*+=] # allowed end chars
‘’’
)[/pre]

Edit: Added fix for exclamation points and question marks.
Edit: Combined some stuff and added support for internal exclamation points; url also shouldn’t start with a period (](http://).); allow parenthesis in the middle of a url
Edit: Add in @ and {} and ] support. Use \b at url beginning.

0 Likes

#13

@facelessuser, you should remove ? as an allowed end character since it makes generally no sense for it to be (GET parameters) and urls are commonly posted before question marks at the end of a question. Not sure about ! as it doesn’t have a special meaning in urls.

Edit: It’s also questionable to include . in a set for identifiers that are separated by .. Should remove that as well.

Edit2: [a-z\d\-._?,'/+&%$#]*[a-z\d\-._?,'/+&%=:"|~;]* is also kind of weird to me. Mind explaining the reasoning behind that?

0 Likes

#14

Hah, yeah. I would agree as they are also sentence punctuation. I guess I haven’t run a case with a URLs in questions or with exclamations :smile: . I’ll update in a bit. It has been something I have been building up, but yeah there is still room for improvements.

0 Likes

#15

I second that! :smiley:

0 Likes

#16

How about Hashbangs? It was pretty common back in the day, and until couple of weeks ago, it was used by feedly (and most likely a lot of legacy apps).

0 Likes

#17

I am not sure I understand in the context of urls. I mean, I know what shebangs are and how the apply on 'nix systems, but you would need to post an example of what you are talking about. Including an exclamation in the middle of a url shouldn’t be a problem and can be added if needed, but if you are referring to allowing a url to end with an exclamtion, that would just be a bad idea in the context of plugin. I would rather be too conservative than too greedy with the url regex as too greedy could botch a lot of perfectly good urls while a little too conservative would miss a few outliers.

0 Likes

#18

Sample:

http://whatever.com/path/to/#!/some-ajax-state

More details: stackoverflow.com/questions/9952 … -bang-urls

0 Likes

#19

Sure. The honest reason was that I originally was trying out different regex from online as I wasn’t feeling up to constructing my own. But sadly I quickly found some where unnecessarily complex, and others were just poor when stressed in certain ways. I was looking for a balance of usability and complexity. I needed one that could find urls reliably within normal written text without being too greedy. So what you see here is some of the original format of the base regex I used before I began modifying it. I imagine the original person who wrote the base regex was thinking quite literally of how urls were constructed, so each regex part represented a part of the url in the person’s mind. I simply haven’t bothered to change that part much, but it is very likely these two parts can be combined safely and still retain just as good accuracy if not better; I would just want to run some tests to be sure. I simply posted what I am currently using and have found good results with. Like I said, it may not be the url regex to end all url regex, but I have had extremely good results with it, and improvements are welcome.

0 Likes

#20

[quote=“iamntz”]Sample:

http://whatever.com/path/to/#!/some-ajax-state

More details: stackoverflow.com/questions/9952 … -bang-urls[/quote]

Cool, I can adjust the regex accordingly. I didn’t know this was a thing :smile:.

0 Likes

#21

Okay, I edited the original post with a couple of improvements. Added support for !(). Combined the path/query stuff. And disallow http://.www.

Feel free to make suggestions. I obviously don’t restrict what can come before the URL, maybe that is something that is important. Maybe a simple \b at the beginning would be fine. Maybe urls that contain unicode would be desired etc. I guess that the is real point, a regex’s quality is measured by your use case.

I mean, you can go crazy with something like this I found online:

_^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/^\s]*)?$_iuS

But I think I was just looking for something that worked well enough in my particular use cases.

0 Likes

#22

Currently, I usecode?(\w.-]+).[a-z]{2,6}(.|/)\S*[/code]

0 Likes

#23

Great to see Sublime going strong again :smiley:

Now, I would like to see AutoComplete window cycle from bottom to top and reverse, it’s frustrating to pop the AC window knowing the element I want is at the end of the list and having to press many times the down arrow key. Please Jon at least add an option in preferences to set this behaviour.

Also, would like to see draging a block of text with mouse to top or bottom of the buffer activate scroll, this is standard behaviour in other editors.

Thanks,
Joao

0 Likes

#24

dragging a block of text with the mouse at the top or bottom of the buffer should activate scrolling

I would like that too. And perhaps enable use of the mouse scroll wheel in this specific context.

0 Likes