This is because we are using an NSDocument to perform the folder searching (as that’s a decoupled way to have the window indicate “unsaved changes” and present a warning sheet).
The downside is that by using an NSDocument we get some undesired implicit behavior, like automatically changing the window title or trying to re-open the “document” after relaunch.
Since switching to ARC we need to ensure the NSWindow is “over-retained” as we rely on “setReleasedWhenClosed:YES”.
Also add ability to close such windows from JavaScript.
We now rely on the table view to obtain the entries and setup the data cell, which should make the code easier to use for other table views with a different data source implementation.
For example searching for items bound to ⌃H will show the fallback item in the Shell Script bundle last (as it’s not scoped). Previously items were alphabetized.
An example where this is desired is when doing a folder search for “foo”, then going to first match and using ⌘E to copy the match to the find pasteboard. This is effectively a no-op except for dropping the auxiliary options that contain other documents with matches (which is what causes ⌘G to advance to next document).
There are situations where we create an OakFileIconImage that won’t be drawn, for example when using it with an NSMenuItem. In that case, we previously paid a somewhat noticeable price in the initializer doing work that was not required.
Previously calling the function with invalid UTF-8 could cause it to iterate over all the data and, if built in debug mode, could cause an assertion failure.
Now we return the sequence’s end when the data appears to be malformed and we never look at more than the last 6 bytes in the sequence.
This is generally desired when the indent of a new line does not (necessarily) depend on lines above it, but where we otherwise do want indent corrections, e.g. HTML.
Previously only the most specialized callback(s) would run. For example creating a command scoped to “source” with “callback.document.will-save” for semantic class would never run for Ruby, Python, etc. because the Source bundle has a “Make Script Executable” callback scoped specifically to “source.ruby”, “source.python”, etc.
Previously if TextMate had expired, we would terminate, which would cause the current session state to be saved, and since it hadn’t yet been restored, we would write out empty session state (and overwrite the user’s previous session state).
Instead we date stamp each entry and do a sorted fetch (with a limit of one) to find next/previous entry (when required).
The reason for moving away from an ordered collection is twofold, the main reason is that NSArrayController does not support ordered collections, so we lose one of the advantages of switching to CoreData. The secondary reason is that using an ordered collection requires that we use an index for “current item” (or maybe liberal use of indexOfObject:) and it’s problematic to ensure that the index is kept 100% in sync with the entries in the collection (especially with bindings and delayed actions).
If an exception is thrown, a dialog is shown. This isn’t very user friendly, but the goal is to call attention to the problem, as I wouldn’t expect any exceptions to be thrown by this method, but I have seen multiple “optimistic locking failure” exceptions despite single-app / single-thread access to the persistent store.
This is required for showing SCM status for “Open Files”. Previously, closing the file chooser with “Open Files” selected and re-opening it, would not have SCM info for the open files.
This is only done for code where running it twice would actually cause a problem.
Dispatch_once is favored over a static boolean only because it seems to carry slightly more semantic information.
This is a minor change of the behavior introduced in 18d9aa030, which made it default to the new --uuid mode when TM_DOCUMENT_UUID was set, and no files were given. This meant that commands (executed from TextMate) could not do something like:
echo foo|"$TM_MATE"
Since there is no way to know if data is actively being sent to mate, we check if the length of data read is zero, and treat that as “no data was sent to mate”, but in theory a command could pipe potential empty user data to mate, which would lead to the wrong behavior. A command that may do this, should unset the TM_DOCUMENT_UUID environment variable.
For example in ruby inserting ‘env⇥’, deleting the initially selected letter, and typing B or S, would insert an additional caret (it was actually inserted in the previous step, but not visible since it was overlapping the existing caret).
The API lack proper support for returning the new caret range so we are using a heuristic to figure out which of the returned ranges correspond to our caret. Ideally the API would be updated.