For example the bundle item “Execute Line / Selection” will (without a selection) show as “Execute Line” in the menu, and now also if the command causes the error sheet to appear or the user press ⌃C / ⌘. to prematurely kill it.
This was previously necessary because we do threaded saving and relied on our run-loop source to be notified when saving completed, but as application termination (presumably) causes TextMate to run in a special run loop mode, we would not receive this notification.
After switching to dispatch queues there no longer is a problem (at least on OS X 10.9.2).
Closes#1030
This would happen for a command that is set to re-use previous output window (when busy). We would kill the running command and wait (in the main dispatch queue) for it to stop, but since the runner is (now) using GCD as well, and updating the “did exit” status in the main queue, we would wait forever.
The state being restored here would be file browser state, which might confuse the user if they are opening a folder via “mate” and then get a file browser restored for that project folder that show another location than the actual folder they open.
The reason we ignore the state when loading, rather than not saving it in the first place, is that by saving the state we make the folder show up in File → Open Favorites…
Additionally, we only re-use a window when the command is the same as what was last associated with the window. So doing a documentation lookup and then building the project will not re-use the (non-busy) documentation window for the build progress.
Closes#733
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.