One spin report shows that an attributed string is being used with the text field. Calling ‘description’ on an attributed string can produce a lot of output (dumping all the attributes) and the spin report in question shows a lot of symbols related to auto-layout and text sizing, so perhaps this is related.
http://lists.macromates.com/textmate/2016-August/039891.html
Previously this would be a no-op basically bringing the undo stack out of sync and making TextMate prone to crashing.
We create an undo group when reloading document changes and here we do not create a document editor, hence when this happened for unselected tabs (which currently have no document editor), the undo stack was brought out of sync.
This was disabled (by accident) during the migration to OakDocument, although we would still backup document content when project properties were changed (like active tab or window size).
The reason we require DocumentController to explicitly enable backups is that we do not want backups for bundle editor and commit window, since these (currently) are unable to restore documents, and the former is never really closed, so the backups would live forever.
This commit turned out rather complex because the only proper way to do this seems to do with a data formatter, but the data formatting protocol assumes that we can construct an object from the editing string, which is not possible when the string only represents a subset of the object being edited.
Unlike the existing setNewDisplayName: this function does not try to figure out if the argument was the file’s display name (with potentially hidden extension).
Unlike path::swap_and_unlink we do not try to use exchangedata() since support for this is missing from the upcoming AppleFileSystem, so it would seem to be somewhat deprecated.
We delay updating callbacks until we have parsed 10 lines to avoid line-by-line redraw of the screen, but incase the buffer got mutated during this batch parsing, we would previously restart the parser and forget about the ranges already parsed (that no-one had been told about).
Incase something earlier in the document became dirty, while in batch update mode, we would keep using the old value of ‘batch_start’ when eventually calling ‘did_update_scopes’.
Under normal circumstances though making the buffer dirty would bump the revision, which drops the batch info, but if e.g. we change grammar, we mark the document dirty without bumping the revision.