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.
Instead we return one of the constants from sysexits.h — the problem with abort() is that, for users with the feature enabled, it will trigger a core dump. That is a bit extreme for somewhat expected problems (like empty input file).
Instead we access it when either we need to submit a crash report, when the preferences window open (where the contact address is shown), or when creating a new bundle (where email is also used for the bundle’s contact).
Previously we would fallback on the grammar’s folding patterns unless ‘foldingStartMarker’ was set, which meant setting just the stop marker or indented folding patterns, would be ignored.
Since we save the history during applicationWillTerminate: there is (in theory) no reason to periodically save the history, but in case of a crash or similar, we would not get to applicationWillTerminate:.