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.
Presently this will also disable it if the folder is opened via the Recent Projects chooser. Ideally opening via this list should not disable folder state restoring.
This means that if one does “mate «folder»”, open a few files as tabs, and then close the window, next time the same folder is opened, TextMate will restore the tabs.
Presently state is remembered (when closing a window) either if the file browser is visible or if more than one document is open in the window.
When opening a document it will be placed to the right of the current one (in the tab bar) even if the document being opened is already in the tab bar, this is to make ⌘W work to “close and go back” without having to keep a list of previously selected tabs.
This feature can now be disabled using:
defaults write com.macromates.TextMate.preview disableTabReordering -bool YES
Note though that if one selects multiple documents to open then it will potentially re-order the tab bar so that the documents selected are adjacent.
An option called "Auto-reveal open file in project browser" has been
added to the Projects preference pane. When checked, the currently open
file will be revealed in the project's file browser. By default, the
option is not checked and thus the behavior is as it was before.
This can be used to force a file to open in a new window, e.g.:
TM_PROJECT_UUID=$(uuidgen) mate README.md
Likewise, it can be used to force multiple invocations of mate to use the initially opened window (by re-using the UUID).
Closes#879
This would happen if last line was not newline terminated.
The fix does not take into consideration that last line might contain non-ASCII, in which case it should be highlighted.
Some valid UTF-8 byte sequences are not valid code points, so our “simple” validation is no guarantee that creating an NSString from the data will succeed.
These normally require that the sender is an NSIndexSet or has one as its represented object, but with this commit, they will also be usable when there is no index set available, and will then simply use the active tab.
This is to avoid cyclic dependencies since it was previously in a somewhat high-level framework, so everything that framework depended on, could not augment crash reports.
It appears a window can hang around after its last tab has been closed. Such window receive notifications of items being deleted via the file browser, and will call the “close tabs” method in response to these, which does an out-of-range array access if no tabs exist.
The reason for why windows can hang around after last tab is closed has not yet been determined. It might be a retain cycle (bug) or a delayed release due to autorelease pools.
Fixes#1064
We now setup the indent settings when creating untitled documents where we know the folder, so that we can use potential settings scoped to that folder.
Since the document itself no longer sets this as part of regular buffer setup, we also set it when opening a document with a path, and when changing a document’s file type, although the latter is probably temporary.
Closes#305.