Sublime Text's Plugin API: It's Python, Sort Of
news.floobits.com
news.floobits.com
Atom may have more momentum and plugins than Sublime right now, but since the core is built upon Chromium rather than Jon's custom beautiful and latency-free cross platform UI framework, it will never suit everyone's needs of performance and responsiveness. The world needs a good native, fast editor with a focus on mouse pointer editing, but only gvim is a viable (and bloated) contender.
Donations for software like this works fantastically, as I know from experience, and the increased momentum of an open source release would increase the number of commercial users willing to ethically support the project. However, if it remains proprietary, ST is still a respectable editor I will be using for the next decade.
I'd be content with source available to licensed users- I've already sunk money into it, why not bug fixes?
subl . and poof, it's up in a directory
atom . 7 or 8 seconds later it's partly up...
I bought ST2 some time ago, and I'd buy ST3 if he pulled the trigger and moved it out of beta... But not if it truly is abandon-ware. I'm willing to pay for quality commercial software, and Sublime Text 3 is high-quality. But I want to know that the project hasn't been walked away from.A license for ST2 is also a license for ST3 beta. He's stated that when ST3 is out of beta, it'll require a new license which I'll likely purchase.
There isn't anything else to buy right now except what I already have.
I think it's gonna start replacing ST as daily driver for a lot of people with this development pace.
https://twistedmatrix.com/users/glyph/rant/extendit.html
See also this comment of his on Advogato, which he indirectly referenced in the previous article:
The issues that Floobits ran into were some of the edge-cases related to distributing a compiled version of Python to various operating systems. I wrote a top-level comment on this page about how Package Control patches these issues.
I pretty much don't consider any installation of Sublime on a new machine as "complete" until it also has Package Control.
The other depends on the person. Usually one of [CMD-O + select directory, CMD-R, CMD-T]
Unfortunately, ST3 is in one of those death-march betas that have been ongoing for years, fragmenting the plugin space. If you write a plugin for ST, you either need to write Python that simultaneously targets Python 2 and Python 3 (possible, but restrictive), or you need to maintain two versions of your plugin.
That's what we did for the WakaTime plugin, and it's worked great for us.
https://github.com/wakatime/sublime-wakatime
We did however have to use external python for the common python core instead of just importing the package, mainly because of the lack of ssl support in the embedded python.
[0]: http://widgetsandshit.com/teddziuba/2011/03/osx-unsuitable-w...
I'm getting the feeling that these days anything a "ninja coder" has written on a Mac is assumed "good" because Mac is "Unix" and therefore the code "has" to be portable.
Is there something about the Mac culture which leads to less considerations about other environments?
That's just asking for problems.
Sublime Text is the only editor we've had to build platform-specific workarounds for. Atom, Emacs, Neovim, IntelliJ and ilk (PyCharm, WebStorm, etc)... none of them have these sorts of bugs. (They have other bugs, but they're consistent across platforms.) Comments such as, "You didn't test it on every platform?!" are succumbing to hindsight bias.
Sublime Text 2 on Windows has an error when importing select. It isn't that Jon didn't include select, but rather there seems to be an issue importing the select.pyd from the folder that sublime_text.exe is located in, with Python 2.6. In fact, Python 2.6 on Windows has all sorts of issues that Jon burned a lot of time trying to work around. For instance, Python 2.6 can't add sys.path entries for folders with non-ascii characters. This led to a hacky work-around where Sublime Text chdirs into each package folder and loads the Python from ".\". Package Control solves the select import by shipping the select.pyd files, but placing them in a package folder and then adding that folder to sys.path.
For Linux, Python creates a _ssl.so shared library shim that links with the system's version of OpenSSL. The downside is that different distros have different versions of OpenSSL - 0.9.x and 1.x.x. This is further compounded by the fact that Fedora has their own specially numbered version of libssl (libssl-10 instead of libssl-1.0.0). So, by distributing a compiled version of Python, there isn't a way to ship the _ssl module for Python that will actually consistently work. Jon seems to have decided to focus his energy on other issues. Package Control patches this issue also. Actually, my SFTP package was the first to patch the issue, but I spent the time to make in generally available to all packages with Package Control 3.0.
So there are two options to deal with _ssl. Jon could try to ship OpenSSL with Sublime Text, thus entering the world of being responsible for patching OpenSSL, and dealing with dynamic linking issues and all that jazz. It gets kind of gross dealing with rpath and all kinds of other work to get the shared lib to look in the current folder first rather than loading the, possibly incorrect, system version of libssl. I've gone down that path before with a project and it was not a fun time. On a side note, Sublime Text on Windows unfortunately does ship OpenSSL, so the version available to Sublime Text plugins can be out-of-date. I've been working on a cross-platform crypto library for Python that uses the OS crypto facilities, which could be a solution for this in the future.
The other option is to rely on the system version of OpenSSL, but provide _ssl.so shims for each of the different major versions of OpenSSL for each architecture. Then ssl.py would have to be patched to try each of the shims until one of them loaded properly. The upside here is that the distro is responsible for updates to OpenSSL. This general approach is what Package Control does, however I don't patch ssl.py. Instead Package Control adds a custom package that is listed alphabetically first, and thus loaded by Sublime Text first. This custom package tries importing each of the shims until it finds one that works with the version of OpenSSL on the system. If you are morbidly curious, you can see the code and shims at https://github.com/codexns/sublime-ssl-linux.
The end result of all of this is that for the majority of ST users, these issues are likely solved. Package Control 3.0 automatically installs these fixes, and provides mechanisms for package developers to share other compiled Python modules. Older versions of Package Control have been EOLed, and thus it is possible for package developers to rely on users having these patches in place.
I encourage everyone who paid for Sublime, a fantastic piece of software that certainly deserves it, to also donate to Package Control.
edit:
If you are asking about the Floobits plugin, ST 2 on OS X shells out to the system python (because of SSL).
So does that fix that issue he says in the end is "still open", about select etc not being present on some platforms?
(I don't have Windows or GUI Linux available to check).
I've been using ST3 dev builds for what, 2 years now? Rock solid all this time on OS X (with around 10 plugins). Only had one issue (high cpu load on search IIRC), that was corrected by going back to the ST3 beta for the 2-3 days it took for it to be fixed.
The ST2 users are part of a significant chunk of developers who just use defaults. They use the default shell, default themes, default mail/calendar/IM client, etc. They don't toolsmith. Their motto is, "If it ain't broke, don't fix it."
Considering the annoyance of dealing with unstable software, I can't blame them... much.