This is instead of setting an environment variable. Since there already is a user defaults setting for whether or not we want an untitled document created at startup, it seems nicer to have mate set that, instead of effectively introducing an alias for the setting.
Using instances with static storage in Objective-C files result in the following warning (starting with clang 425.0.24):
ld: warning: direct access in […] to global weak symbol […] means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
Selecting already selected page no longer reloads the HTML.
In addition to ⌘1-n for the n’th page, you can now also use ⌘{ and ⌘} to move between pages.
We manually handle the Bundles menu (like before) and now use performActionForItemAtIndex: to make the menu flash (although presently only for the default items).
For the other menus we now call super and let that handle it. This means it might go into the Bundles menu, even though or menu delegate (for that menu) will say there are no key equivalents. This is only a problem for keys which do match items, but where all the items it matches are not supposed to fire.
My memory is a little vague here, but I believe the point of handling the menu keys was to workaround a bug in NSMenu.
The bug was that NSMenu would look at (the target of) cached menu items, probably for UI validation, so potentially sending methods to unretained objects, which could lead to a crash. Several workarounds were attempted (like clearing the target property after the menu had been displayed) but the only effective one was overloading key handling.
I’m quite sure though that this bug is no longer relevant.
Removed the ability to specify wether documents should open in current window or a new window — all documents opened via this API will go through the same algorithm to find where the documents should end up (more choice is just adding confusion and complexity).
It didn’t really make sense as an instance method since it iterate all instances, and we also want to execute code incase of no instances (save that fact as session data).
Since everything about session is now contained in the DocumentController class there is no need for invoking this from elsewhere and thus no need for the previous indirection.
Previously we would let NSURL parse the parameter and ask for the path component. This however does not support tilde as shorthand for the user’s home directory, and certainly not with TextMate 1.x’s questionable syntax (using ‘file://~/«file»’ instead of ‘file://localhost/~/«file»’ or possibly ‘file:///~/«file»’ although this one seems a little wrong).
As for percent escapes, the issue here is that if the URL parameter escapes slashes or colons, not decoding the URL parameter before creating an NSURL instance will fail (as the URL is malformed). If however we do decode percent escapes and the URL parameter contains spaces, then NSURL will also fail, as a URL with spaces is malformed.
So I ended up bypassing NSURL and check for a few variants of a ‘file://’ prefix (which is also what TextMate 1.x did).
This closes issue #602.
This can be used to link to the “current document” even if that document has no path. Previously this was done by leaving out the ‘url’ parameter, which made it target the frontmost document — using ‘uuid’ is a more robust way to achieve the same.
A command can read the TM_DOCUMENT_UUID environment variable for the current document’s identifier.
We regularly iterate through all open windows and test if these are document controller windows. It will be easier to let the document controller class (or application delegate) manage a list of open document windows, as we anyway need some sort of owner with ARC (currently the instances own themselves and give up ownership in windowWillClose: which cause them to be released).
We now remember values like file browser history even if the file browser is not shown while saving session state (but has previously been, or state was provided during setup). We also use the file browser and HTML output sizes stored in the session info (previously we only used values from NSUserDefaults).
If the plug-in doesn’t set TMPlugInAPIVersion to 2 (in its Info.plist) a dialog will show, telling the user that the plug-in is not compatible with the current version of TextMate (which is most likely correct).
You can hold down option (⌥) to open the plug-in as a regular folder.
Addresses issue #392.
We no longer require that the bundle identifier starts with ‘com.macromates’ instead the plug-in MUST set the TMPlugInAPIVersion key (in its Info.plist) to ‘2’ (the current API version).
There is currently no way to add a TextMate (1.x) license to the key chain, but those who used TextMate r9147 or earlier should have one stored already.
We have to go via OakSubmenuController because the menu item may not exist. The reason for this is related to not having old menu items exist after a delegate has disappeared, though it might be possible to improve.
You can still create an alias for ‘mate’ that calls ‘mate --recent’.
The motivation for this change is that stuff you open via mate is generally SCM commit messages, the cron tab, included files (opened from within TextMate via bundle commands), and other such things. Additionally I think that if you open files via ‘mate’ you would just repeat the line in your shell, though I know not all users feel this way.
Folders opened via mate does go into the recent menu.
We now have:
- performBundleItem:
- performBundleItemWithUUIDString:
- performBundleItemWithUUIDStringFrom:
I’m leaning toward changing the prefix, as ‘perform’ is mainly action methods invoked as a direct response to some user action (with that action part of the name), but haven’t found a better prefix yet.